Hello,<div>I am trying to understand the effect ConfirmationListeners have on channel closing. �It looks like if messages are published with &quot;mandatory=true&quot;, the corresponding Channel.close will block until all notifications have been received (unsure of any timeout, I&#39;ve seen it block for over a minute). �I understand &quot;mandatory&quot; to mean &quot;return the message to all Return/Confirm listeners&quot;. �Is this blocking behavior also part of mandatory behavior, or should close() happen immediately?</div>
<div><br></div><div>Something else interesting happens when you close a channel with pending callbacks: listeners are immediately removed. �The consequence is you block until all confirmations/returns have happened, but your listeners don&#39;t receive them. �</div>
<div><br></div><div>Here&#39;s some example code:</div><div><a href="https://gist.github.com/1665378">https://gist.github.com/1665378</a></div><div><br></div><div>If you call this with�</div><div><div>RabbitTest.publish(0, exchange, routingKey, msg, brokerAddress);</div>
<div>prints &quot;0 callbacks, waited 0ms before close, close took 5959&quot;</div><div><br></div><div>RabbitTest.publish(5000, exchange, routingKey, msg, brokerAddress);</div></div><div>prints &quot;427 callbacks, waited 5000ms before close, close took 833&quot;</div>
<div><br></div><div>Note how both take roughly 5800ms. �On the first call, we don&#39;t pause before calling close, and receive 0 callbacks. However, the second one, which waits 5000ms before trying to call close, gets most of the callbacks. �A longer pause before close results in all callbacks being handled.</div>
<div><br></div><div>To reproduce this, I use a roughly 200 character string as my message. �It&#39;s also important that the message be published as &quot;persistent&quot; - I think transient messages are too fast to reveal this :)</div>
<div><br></div><div>Should callbacks block close? �If so, should listeners continue to receive callbacks as close happens?</div><div><br></div><div>Thank you,</div><div>Adam</div>