[rabbitmq-discuss] Published message not queued after publish-ok received when connection quickly closed

Michael Klishin michael.s.klishin at gmail.com
Fri Jul 8 15:19:07 BST 2011


2011/7/8 Michael Nacos <m.nacos at gmail.com>

> so, what's currently the best way to publish messages consumed from one
> queue into another with the amqp gem?
>

Just republish them or take


> This is quite important in processing scenaria when no messages may be
> lost. In particular, is the following code safe? Will the pseudo-synchronous
> *publish* 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 ?
>

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):

http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Exchanges.textile#Publishing_callback__Reliable_delivery_in_distributed_environments

An examples of publishing confirmations extension in action:
https://github.com/ruby-amqp/amqp/blob/master/examples/extensions/rabbitmq/publisher_confirmations_with_transient_messages.rb

I am not sure what "(:nowait => false)" is referring to, can you please
explain?
-- 
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/20110708/993ee5f8/attachment.htm>


More information about the rabbitmq-discuss mailing list