[rabbitmq-discuss] How to use AMQP inside Rails ActiveRecord to publish some messages
Michael Klishin
michael.s.klishin at gmail.com
Sun Oct 23 22:31:09 BST 2011
2011/10/23 Eki <eqbal.quran at gmail.com>
> 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
>
You need to connect to the broker when your app boots and then use a shared
(or not) AMQP::Exchange instance.
See
http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/ConnectingToTheBroker.textile
,
http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/GettingStarted.textile#Integration_with_objects
and https://github.com/michaelklishin/rubyonrails23_unicorn_amqp_gem_example
--
MK
http://github.com/michaelklishin
http://twitter.com/michaelklishin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111024/4d4cd397/attachment.htm>
More information about the rabbitmq-discuss
mailing list