[rabbitmq-discuss] erlang client and server disconnection

Matthias Radestock matthias at lshift.net
Mon Jun 8 23:13:00 BST 2009


Jack,

Jack Moffitt wrote:
> The Erlang client doesn't seem to detect that its socket is dead.  If
> I start publishing to an exchange, then kill the server, future
> publishes continue without error.  I would think that barring normal
> TCP issues, destroying the server would cause amqp_channel:cast/3 to
> error on the next call as the channel should no longer be valid.
> 
> Is this a bug, or is my code supposed to be getting connection error
> notifications via some other mechanism?

amqp_channel:cast/3 does, as the name suggests, a gen_server:cast, which 
is totally asynchronous. The channel process should die when the 
connection dies, and the 'Erlang way' to get a notification of that 
event is to link to or monitor the channel process.


Regards,

Matthias.




More information about the rabbitmq-discuss mailing list