<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">No it won�t. The normal ordering guarantees are observed.  The thread dispatching algorithm ensures that consumers <i>on the same channel</i> are called serially.<div><br><div>Each call might run on a different thread (or the same thread � the calls might be batched if many messages arrive at once), but, on a particular channel, there is at most one thread working on a consumer callback (like handleDelivery()) at any time.<br><div><br class="webkit-block-placeholder"></div><div>I thought this was clearly spelt out in the Java Client Doc, but I can only find this:</div></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div><div><p style="clear: left; color: rgb(85, 85, 85); font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">Callbacks to <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span>s are dispatched on a thread separate from the thread managed by the <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Connection</span>. This means that <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span>s can safely call blocking methods on the <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Connection</span> or <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Channel</span>, such as<span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">queueDeclare</span>, <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">txCommit</span>, <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">basicCancel</span> or <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">basicPublish</span>.</p></div></div></div><div><div><p style="clear: left; color: rgb(85, 85, 85); font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px; background-color: rgb(255, 255, 255); position: static; z-index: auto;">Each <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Channel</span> has its own dispatch thread. For the most common use case of one <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span> per <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Channel</span>, this means <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span>s do not hold up other <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span>s. If you have multiple <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span>s per <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Channel</span> be aware that a long-running <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span> may hold up dispatch of callbacks to other <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Consumer</span>s on that <span class="code " style="color: rgb(51, 51, 51); font-family: 'Courier New', Courier, monospace; font-size: small; white-space: nowrap;">Channel</span>.</p></div></div></blockquote><div><div>which occurs (buried) in the <a href="http://www.rabbitmq.com/api-guide.html#channel-threads">Channel Thread Safety</a> section. Maybe this should be improved (and a note put in the Consumer Thread Pool section).</div><div><br></div><div>
<div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span class="Apple-style-span" style="border-spacing: 0px; border-collapse: separate;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span class="Apple-style-span" style="font-size: 12px;">Steve Powell  </span><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-span" style="font-size: 11px;">[</span></font><i><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-span" style="font-size: 11px;">Cell</span></font></i><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-span" style="font-size: 11px;">: +44-7815-838-558</span></font><font class="Apple-style-span" face="Georgia" size="3"><span class="Apple-style-span" style="font-size: 11px;">]</span></font></div></span></div></span></div></span><div style="orphans: 2; widows: 2; font-size: 12px;"><span class="Apple-style-span" style="border-collapse: collapse;"><font class="Apple-style-span" color="#3b3b3b"><font color="#000000" size="1"><span style="line-height: 14px;"><i>    Good design</i> [</span></font><font size="1"><span style="line-height: 14px;">�</span></font><font color="#000000" size="1"><span style="line-height: 14px;">]</span></font></font></span><span class="Apple-style-span" style="text-align: -webkit-auto; border-collapse: collapse; line-height: 14px;"><span class="Apple-style-span" style="font-size: 10px;"><font class="Apple-style-span" color="#3b3b3b"> </font></span></span><i style="text-align: -webkit-auto; color: rgb(59, 59, 59); font-size: 10px; line-height: 14px;">is as little design as possible.    </i><span style="color: rgb(102, 102, 102); font-size: 6px; line-height: 14px; text-align: -webkit-auto;">Dieter Rams</span></div></div>
</div>
<br><div><div>On 3 Apr 2014, at 16:04, Michael Klishin <<a href="mailto:mklishin@gopivotal.com">mklishin@gopivotal.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite" style="font-family: Georgia; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I have also tested it several times and saw that the order is saved.<span class="Apple-converted-space"> </span><br>Just to make sure - since different threads call handle delivery<span class="Apple-converted-space"> </span><br>- will it mess my order?<br></blockquote><br style="font-family: Georgia; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Georgia; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">By default the pool has 5 threads, so yes. You can provide your own</span><br style="font-family: Georgia; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Georgia; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">executor on ConnectionFactory, e.g. to use a single threaded executor.</span><br style="font-family: Georgia; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></blockquote></div><br></div></body></html>