[rabbitmq-discuss] How to reuse and existing connection but have different channel
cwstorm at gmail.com
Wed Feb 26 17:21:40 GMT 2014
I've added the channel.setConfirmListener(new ConfirmListener() and
imported com.rabbitmq.client.ConfirmListener but during java compilation,
it complains :
cannot find symbol
symbol : method setConfirmListener(<anonymous
location: interface com.rabbitmq.client.Channel
On Wed, Feb 26, 2014 at 11:43 AM, Jerry Kuch <jkuch at gopivotal.com> wrote:
> 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?
> 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,
>> 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
> 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.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss