<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-02-07 17:55 GMT+04:00 cw storm <span dir="ltr"><<a href="mailto:cwstorm@gmail.com" target="_blank">cwstorm@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Not sure I understand.  "Make sure your code is prepared for that."  What do you mean by that.  </blockquote><div><br></div><div>You instantiate Connection and Channel in one thread (often the main thread) but incoming messages</div>

<div>are dispatched from a different thread ("main loop" or "network I/O thread") into a pool every connection</div><div>has.</div><div><br></div><div>You need to make sure that the objects used in handleDelivery are initialized in a thread safe</div>

<div>manner (e.g. not lazily). A null pointer exception coming from handleDelivery suggests the problem</div><div>is with one of the objects you use there.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Also, if thread pool, will it close once the broker receive a "basicAck"?</blockquote></div><br><div>If you did not provide a custom executor service to ConnectionFactory#newConnection, it will be</div><div>shut down when connection is closed. Otherwise it's up to you to shut it down on application</div>

<div>shutdown.</div>-- <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>


</div></div>