<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Currently, my publisher code instantiate a connection/channel and closes it if all successful. �Is it possible to reuse an existing connection but have separate channel every time produces a message to rabbit?<br>
</div></div></blockquote><div><br></div><div>It's not clear why you would want to create a new channel per message. �Typically one gets a connection, then multiplexes it into separate channels and uses each channel for some conceptually related chunk of behavior, e.g. publishing notifications of some sort, consuming messages, etc.�</div>
<div>�</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div>
<div>Also, after the basicPublish is executed, what do I check in the next line of code to make sure the broker have persisted or receive the message successfully.<br></div></div></blockquote><div><br></div><div>If you want such an assurance you'll either have to perform that publish with the context of an AMQP transaction (synchronous and kind of expensive) or use publisher confirms, in which case you register an asynchronous listener for confirm receipts that the broker sends when it's done what you asked for, to the standard you asked.</div>
<div><br></div></div></div></div>