<br><br><div class="gmail_quote">2011/10/23 Eki <span dir="ltr">&lt;<a href="mailto:eqbal.quran@gmail.com">eqbal.quran@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div id=":1lm">To be more specific, lets say, I have a model called Bet, and I wanna<br>
trigger the event after create a record to publish something in the<br>
queue called test for example </div></blockquote></div><br>You need to connect to the broker when your app boots and then use a shared (or not) AMQP::Exchange instance.<div><br></div><div>See <a href="http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/ConnectingToTheBroker.textile">http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/ConnectingToTheBroker.textile</a>, <a href="http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/GettingStarted.textile#Integration_with_objects">http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/GettingStarted.textile#Integration_with_objects</a></div>

<div><br></div><div>and <a href="https://github.com/michaelklishin/rubyonrails23_unicorn_amqp_gem_example">https://github.com/michaelklishin/rubyonrails23_unicorn_amqp_gem_example</a><br clear="all"><div><br></div>-- <br>

MK<br><br><a href="http://github.com/michaelklishin" target="_blank">http://github.com/michaelklishin</a><br><a href="http://twitter.com/michaelklishin" target="_blank">http://twitter.com/michaelklishin</a><br><br>
</div>