2011/7/8 Michael Nacos <span dir="ltr"><<a href="mailto:m.nacos@gmail.com">m.nacos@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>so, what's currently the best way to publish messages consumed from one queue into another with the amqp gem? </div></blockquote><div><br>Just republish them or take<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>This is quite important in processing scenaria when no messages may be lost. In particular, is the following code safe? Will the pseudo-synchronous <b>publish</b> call return only after the message has been accepted in the second queue (:nowait => false)? otherwise, what would be the point of wrapping the publish call with @channel.tx_select / @channel.tx_commit ?</div>
</blockquote><div><br>Exchange#publish returns as soon as your data was placed into an outgoing data buffer. This is documented in detail (including why knowing that you message was received is impossible without receiving an acknowledgement for it):<br>
<br><a href="http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Exchanges.textile#Publishing_callback__Reliable_delivery_in_distributed_environments">http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Exchanges.textile#Publishing_callback__Reliable_delivery_in_distributed_environments</a><br>
<br>An examples of publishing confirmations extension in action:<br><a href="https://github.com/ruby-amqp/amqp/blob/master/examples/extensions/rabbitmq/publisher_confirmations_with_transient_messages.rb">https://github.com/ruby-amqp/amqp/blob/master/examples/extensions/rabbitmq/publisher_confirmations_with_transient_messages.rb</a><br>
<br>I am not sure what "(:nowait => false)" is referring to, can you please explain?<br></div></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>