[rabbitmq-discuss] How to close connection and channel when an exception occur

cwstorm cwstorm at gmail.com
Fri Sep 27 15:15:57 BST 2013


I believe I had tried it once before and had a compiler error because the connection had to be thrown or caught which is why I have it inside the try block.

Sent from mobile device with autocorrect.

Phil

> On Sep 27, 2013, at 9:38 AM, Emile Joubert <emile at rabbitmq.com> wrote:
> 
>> On 27/09/13 14:31, Phil wrote:
>> "channel.close() or conn.close()" in the catch  or finally
>> block.  
> 
> You probably declared the channel and conn variables in the scope of the
> "try" block. Try declaring them before the "try" block.
> 
> 
> 
> -Emile


More information about the rabbitmq-discuss mailing list