<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">(Copy for the discussion list.)<br><div><br class="webkit-block-placeholder"></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: Georgia; ">Steve Powell</span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div style="font-family: Helvetica; "><font class="Apple-style-span" face="Georgia"><i><a href="mailto:steve@rabbitmq.com">steve@rabbitmq.com</a></i></font></div></div><div style="font-family: Helvetica; "><div><div><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; ">[</span><i>wrk</i><span class="Apple-style-span" style="font-size: 10px; ">: +44-2380-111-528] [</span><i>mob</i><span class="Apple-style-span" style="font-size: 10px; ">: +44-7815-838-558]</span></font></div><div><font class="Apple-style-span" face="Georgia" size="2"><span class="Apple-style-span" style="font-size: 10px; "><br></span></font></div><div style="font-size: 12px; "><font class="Apple-style-span" face="arial" size="3"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 13px; "><i></i></span><i></i></font></div></div></div></span></span></span>
</div>
<div>------reply from ML <span class="Apple-style-span" style="font-size: 12px; "><span class="Apple-tab-span" style="white-space:pre">        </span></span><span class="Apple-style-span" style="font-size: 12px; "><span style="color: #7f7f7f"><b>Date: </b><span class="Apple-tab-span" style="white-space:pre">        </span></span></span><span class="Apple-style-span" style="font-size: 12px; ">19 July 2012 14:48:02 GMT+01:00</span></div><span class="Apple-style-span" style="font-family: tahoma, sans-serif; ">Dear Steve,</span><span class="Apple-style-span" style="font-family: tahoma, sans-serif; "><br></span><span class="Apple-style-span" style="font-family: tahoma, sans-serif; ">Thanks for your help :)</span><span class="Apple-style-span" style="font-family: tahoma, sans-serif; "><br></span><span class="Apple-style-span" style="font-family: tahoma, sans-serif; ">I read that tutorial before and developed a project-specific usage of rabbitMQ.</span><span class="Apple-style-span" style="font-family: tahoma, sans-serif; "><br></span><span class="Apple-style-span" style="font-family: tahoma, sans-serif; ">your answer was very helpful to me.</span><span class="Apple-style-span" style="font-family: tahoma, sans-serif; "><br><span class="Apple-style-span" style="font-family: Helvetica; ">-- </span><br></span><div><div dir="ltr"><font size="2" style="color: rgb(51, 0, 153); font-family: tahoma, sans-serif; "><span><span><span><span style="color: rgb(0, 0, 0); ">Sincerely </span><br style="color: rgb(0, 0, 0); "><span style="color: rgb(0, 0, 0); ">ML</span></span></span></span></font><br></div><div><br></div><div>On 19 Jul 2012, at 12:11, Steve Powell wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>ML,<br><br>I realise that I haven't really answered your question:<br><br><blockquote type="cite"><blockquote type="cite">what should I do to route consumers ack to producer?<br></blockquote></blockquote><br><br>The RabbitMQ broker isolates the publishers from knowledge of the<br>consumers and vice versa; this includes knowing if there are there and<br>have acknowledged the message. This makes it tricky to get RabbitMQ to<br>do what you want directly.<br><br>One way to achieve it is to use reply-to queues: temporary queues which<br>the publisher sets up (for a particular message, or for many messages)<br>which the consumer can then publish a response to. If the reply-to queue<br>is provided to the consumer with the published message, the consumer can<br>programmatically respond to the publisher without having to know who the<br>publisher is (or if it is available, etc.).<br><br>This mechanism is exploited in the RPC tutorial [1], which you should<br>read. With RPC, the client (caller) blocks until the reply is received;<br>but you might not want to do that. I'm sure this will help you to<br>implement a solution for your case.<br><br>Good luck,<br><br>Steve Powell<br><a href="mailto:steve@rabbitmq.com">steve@rabbitmq.com</a><br>[wrk: +44-2380-111-528] [mob: +44-7815-838-558]<br><br>[1] http://www.rabbitmq.com/tutorials/tutorial-six-java.html<br><br><blockquote type="cite">ML,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The definitive guide to Publish-confirms is in the extensions<br></blockquote><blockquote type="cite">documentation [1], where it says:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">By confirming a message the broker assumes responsibility for it and<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">indicates that it has done something it deems reasonable with it.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Unroutable mandatory or immediate messages are confirmed right after<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">thebasic.return. Transient messages are confirmed as soon as they arrive<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">on all the queues they were routed to. Persistent messages are confirmed<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">when all queues have either delivered the message and received an<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">acknowledgement (if required), or persisted the message.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Notice that a confirmation does not necessarily mean that a consumer has<br></blockquote><blockquote type="cite">received and acknowledged the message; in general it means that RabbitMQ<br></blockquote><blockquote type="cite">has successfully 'processed' the message, which might mean 'persisted' it, if<br></blockquote><blockquote type="cite">it is persistent, or returned it, if it was unroutable (and marked<br></blockquote><blockquote type="cite">mandatory), etc.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">You may wish to investigate the 'immediate' and 'mandatory' flags. Be<br></blockquote><blockquote type="cite">aware that you cannot use 'publisher confirms' on a transactional<br></blockquote><blockquote type="cite">channel.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">[1] http://www.rabbitmq.com/extensions.html#confirms<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Steve Powell<br></blockquote><blockquote type="cite">steve@rabbitmq.com<br></blockquote><blockquote type="cite">[wrk: +44-2380-111-528] [mob: +44-7815-838-558]<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 19 Jul 2012, at 10:25, Mohsen Lotfizad wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Hi<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I have a project that producers want to assure their message are delivered to consumers.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I make a Google search and find rabbitMQ transaction and confirm from (http://www.rabbitmq.com/blog/2011/02/10/introducing-publisher-confirms/) . I download discussed examples and run them. But I comment the consumer part. with my surprise producer gives ack, even if I uncomment consumer part and send NACK instead of ack!<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">what should I do to route consumers ack to producer?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">ps: does com.rabbitmq.client.Channel#addReturnListener helps me?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-- <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Sincerely <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">ML<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">rabbitmq-discuss mailing list<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">rabbitmq-discuss@lists.rabbitmq.com<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">rabbitmq-discuss mailing list<br></blockquote><blockquote type="cite">rabbitmq-discuss@lists.rabbitmq.com<br></blockquote><blockquote type="cite">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br></blockquote><br>_______________________________________________<br>rabbitmq-discuss mailing list<br>rabbitmq-discuss@lists.rabbitmq.com<br>https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss<br></div></blockquote></div><br></body></html>