<font color="#333333"><font face="tahoma,sans-serif">Hello,</font></font><div><font color="#333333"><font face="tahoma,sans-serif"><br></font></font></div><div><font color="#333333"><font face="tahoma,sans-serif">I&#39;ve done some searching but can&#39;t seem to answer a couple of questions. �In the API guide, I saw:</font></font></div>
<div><font color="#333333"><font face="tahoma,sans-serif"><br></font></font></div><div><font color="#333333"><font face="tahoma,sans-serif">&quot;</font></font><font color="#333333" face="tahoma, sans-serif">Channel instances are safe for use by multiple threads. Requests into a Channel are serialized, with only one thread being able to run a command on the Channel at a time. Even so, applications should prefer using a Channel per thread instead of sharing the same Channel across multiple threads.</font><span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">&quot;</span></div>
<div><span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"><br></span></div><div><span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">And in the Javadocs for Channel, I saw:</span></div><div><span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"><br>
</span></div><div><span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">&quot;</span><font color="#333333" face="tahoma, sans-serif">While a Channel can be used by multiple threads, it&#39;s important to ensure that only one thread executes a command at once. Concurrent execution of commands will likely cause an UnexpectedFrameError to be thrown.</font><span style="color:rgb(51,51,51);font-family:tahoma,sans-serif">&quot;</span></div>
<div><span style="color:rgb(51,51,51);font-family:tahoma,sans-serif"><br></span></div><div><font color="#333333" face="tahoma, sans-serif">Currently, our service shares the same channel�across�each request thread and we synchronize the call to &#39;basicPublish&#39;. �Looking at the basicPublish code, it looks like the sequence number member variable is not thread safe but it doesn&#39;t affect us since we&#39;re not ack&#39;ing our messages.</font></div>
<div><font color="#333333" face="tahoma, sans-serif"><br></font></div><div><font color="#333333" face="tahoma, sans-serif">My questions are:</font></div><div><font color="#333333" face="tahoma, sans-serif">1. Should we be using a channel per thread considering that we&#39;re synchronizing the basicPublish call anyway?</font></div>
<div><font color="#333333" face="tahoma, sans-serif">2. Can we just share one channel across all threads and not synchronize the call to basicPublish?</font></div><div><font color="#333333" face="tahoma, sans-serif"><br></font></div>
<div><font color="#333333" face="tahoma, sans-serif">Thanks,<br>Laurent</font></div>