<br><br><div class="gmail_quote">2011/7/8 Jim Irrer <span dir="ltr">&lt;<a href="mailto:irrer@umich.edu">irrer@umich.edu</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div id=":29j">For the Java client API, the RabbitMQ documentation says that<div>a single channel should not be used by more than one thread, but</div><div>it does not explicitly say anything about connections.</div>

<div><br></div></div></blockquote><div><br>AMQP assumes that one connection is typically used by more than one channel. So<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div id=":29j"><div></div><div>Is it ok to have multiple threads (each with their own channel)</div><div>sharing the same connection?</div></div></blockquote><div><br>if channels are not shared between threads, then yes.<br>

 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div id=":29j"><div>Is there some advantage (performance</div><div>or otherwise) to using a single connection verses multiple ones?</div>

</div></blockquote><div><br>If all connections use the same credentials and connect to the same broker/vhost, then no<br>(this should read: in vast majority of cases, no).<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div id=":29j">

<div>BTW - I&#39;m assuming that each connection corresponds to a</div><div>socket, and so opening lots of them consumes a somewhat limited</div><div>system resource.</div></div></blockquote></div><br>Long story short, this is true. Each connection has a frame handler that opens a new socket.<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>