[rabbitmq-discuss] Recovering after forced connection close

Chris Duncan celldee at gmail.com
Wed Oct 14 13:01:10 BST 2009


I'm trying to make sure that I handle reconnection correctly in the  
event that RabbitMQ forces connection closure or a broken pipe  
condition occurs. I'm using RabbitMQ 1.7.0 with Erlang 12-B and the  
bunny Ruby client v0.6.0 for testing. If I shutdown the server while  
my client is connected or invoke an AMQP method with incorrect  
arguments I can create the condition whereby RabbitMQ will forcefully  
close the connection. What I'm seeing is this type of error in the  
log when I try to reconnect with the same client instance -

exception on TCP connection <0.1567.0> from 127.0.0.1:57174
{channel_frame_while_starting,1,starting,
                               {method,'connection.start_ok',
                                        
<<0,0,0,102,8,112,108,97,116,102,111,
                                          
114,109,83,0,0,0,4,82,117,98,121,7,
                                          
112,114,111,100,117,99,116,83,0,0,0,
                                          
5,66,117,110,110,121,11,105,110,102,
                                          
111,114,109,97,116,105,111,110,83,0,
                                          
0,0,31,104,116,116,112,58,47,47,103,
                                          
105,116,104,117,98,46,99,111,109,47,
                                          
99,101,108,108,100,101,101,47,98,117,
                                          
110,110,121,7,118,101,114,115,105,
                                          
111,110,83,0,0,0,5,48,46,54,46,49,8,
                                          
65,77,81,80,76,65,73,78,0,0,0,35,5,
                                          
76,79,71,73,78,83,0,0,0,5,103,117,
                                          
101,115,116,8,80,65,83,83,87,79,82,
                                          
68,83,0,0,0,5,103,117,101,115,116,5,
                                         101,110,95,85,83>>}}

I can connect with another instance without difficulty. Firstly, can  
anyone explain why this error is occurring in the circumstances that  
I have outlined and secondly, is there a way that I can reconnect  
using the same client instance.

I'm sure that I read something that stated that this is the correct  
behaviour for an AMQP server, but unfortunately I can't recall where  
I read it.

Regards,

Chris 




More information about the rabbitmq-discuss mailing list