[rabbitmq-discuss] Issue in Java client while fetching channel

Anand Ved anand.ved at Xoriant.Com
Wed Aug 5 02:24:44 BST 2009


Ben,

As per the java client documentation, channel is not thread safe and I have multiple threads that would publish messages to the Q. For each publish, I create a new channel and publish the message. 

Earlier I was not closing the channel and this lead to connection.createChannel() returning null object. Now as per java client document again, it is stated that if there are no channels available or if the current channel number is currently in use, then it would return null. Hence now I have closed the channel after each publish.

If you are aware of any other case where we may end up getting a null channel, then please let me know.

Regards,
Anand Ved | Xoriant Solutions Pvt. Ltd.  
Modern technology, Owes ecology, An apology. ~Alan M. Eddison - Go Green!!

-----Original Message-----
From: Ben Hood [mailto:0x6e6562 at gmail.com] 
Sent: Wednesday, August 05, 2009 4:01 AM
To: Anand Ved
Cc: rabbitmq
Subject: Re: [rabbitmq-discuss] Issue in Java client while fetching channel

Anand,

On Tue, Aug 4, 2009 at 7:44 PM, Anand Ved<anand.ved at xoriant.com> wrote:
> Investigation lead to my not closing the channel after publishing a message.
> And I have now closed the channel as soon as I publish.

Why do have to close the channel after you publish each message?

Ben




More information about the rabbitmq-discuss mailing list