<br><br><div class="gmail_quote">2011/7/8 Michael Klishin <span dir="ltr">&lt;<a href="mailto:michael.s.klishin@gmail.com">michael.s.klishin@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 class="im">2011/7/8 Michael Nacos <span dir="ltr">&lt;<a href="mailto:m.nacos@gmail.com" target="_blank">m.nacos@gmail.com</a>&gt;</span><br></div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div>so, what&#39;s currently the best way to publish messages consumed from one queue into another with the amqp gem? </div></blockquote></div><div><br>Just republish them or take</div></div></blockquote></div><br>Disregard this part. I now understand the question better. With a multi-step workflow, when one application (A1) consumes messages from one queue, processes them and publishes the original message or a different one to another queue, you need to use a combination of features:<br>

<br>1. Explicit message acknowledgements<br><br><a href="http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Queues.textile#Message_acknowledgements">http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Queues.textile#Message_acknowledgements</a><br>

<br><br>2. Publisher confirmations<br><br>The only way to know that your re-published message is received by the broker is to receive an acknowledgement from it.<br>I now realize that documentation section does not provide any code examples. I will put something together later today.<br>

<br><a href="http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Exchanges.textile#Using_Publisher_Confirms_extension_to_AMQP_0_9_1">http://rubydoc.info/github/ruby-amqp/amqp/master/file/docs/Exchanges.textile#Using_Publisher_Confirms_extension_to_AMQP_0_9_1</a><br clear="all">

<br><br>So A1 would consume a message, process it, republish it and as soon as publishing confirmation arrives, A1 acknowledges the original one.<br>-- <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>