[rabbitmq-discuss] How to reuse and existing connection but have different channel

cw storm 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
com.rabbitmq.client.ConfirmListener>)
location: interface com.rabbitmq.client.Channel
channel.setConfirmListener(new ConfirmListener()


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,
> etc.
>
>
>> 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.
>>
>
> 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
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140226/91fff604/attachment.html>


More information about the rabbitmq-discuss mailing list