[rabbitmq-discuss] How to use AMQP inside Rails ActiveRecord to publish some messages
eqbal.quran at gmail.com
Sat Oct 22 22:09:29 BST 2011
I'm using Rails (3.0.5), Would love to know the best way to publish a
messages from inside my rails application .
To be more specific, lets say, I have a model called Bet, and I wanna
trigger the event after create a record to publish something in the
queue called test for example .
class Bet < ActiveRecord::Base
users = User.all
users.each do |user|
MQ.queue("test").publish("some cool message here")
What is the best way inside rails to do that ? where to load AMQP ?
inside model ? inside Environment ? and how to use it more
Thanks in advance .
More information about the rabbitmq-discuss