[rabbitmq-discuss] Channel takes everyone down?

James Aimonetti james at 2600hz.com
Wed Jul 20 22:33:12 BST 2011

Hash: SHA1


Thanks for the response. I did indeed have a solution similar to Run2(),
but was finding channels were leaking, in that the third party
monitoring process wasn't shutting the channels down when the consumer

Linking the two was my quick solution to the problem but I guess not
feasible at the moment. I'll re-work my monitoring code and see if I
can't sniff out the leak.

Thanks again,


On 07/20/2011 02:00 PM, Alexandru Scvorţov wrote:
> Hi James,
>> However, when a consumer has a non-normal exit, the channel goes down,
>> but the exit signal bubbles up all the way to where *all* other channels
>> go down as well.
> I've just tried it and you're right: sending a non-normal exit to a
> channel will cause the connection to go down, taking all the other
> channels with it.
> For what it's worth, this also happens with 2.5.1 and we don't have any
> plans to change this behaviour right now.  It happens because channels
> don't trap exits.
> I'm afraid there isn't anyway to do it automatically.  You could start
> a separate process that traps exits and is linked to your consumer.
> When you receive an exit from the consumer, close its channel cleanly.
> So, a very basic supervisor.
> Maybe something like this:
>   https://gist.github.com/1095910
> Run() is what I think you're doing.  Run2() starts up a separate thread
> to monitor the consumer and close its channel when the time comes.
> That's 2.5.1 code, btw: the parameters for connection:open/1 changed a
> bit.
> Hope this helps.
> Cheers,
> Alex
> On Tue, Jul 19, 2011 at 02:20:59PM -0700, James Aimonetti wrote:
> My setup is as follows: I have a channel per consumer, and I'm trying to
> link the consumer to the channel so that if either dies, the other goes
> down (most consumers are ephemeral and easy to restart, those that are
> longer living trap exits).
> However, when a consumer has a non-normal exit, the channel goes down,
> but the exit signal bubbles up all the way to where *all* other channels
> go down as well.
> Any pointers how to link a consumer to its channel without taking the
> whole tree of channels down?
> This is with rabbitmq server and erlang-client 2.4.1 and r14b03.
> Thanks!
> James
rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com

- -- 
James Aimonetti
Distributed Systems Engineer / DJ MC_

2600hz | http://2600hz.com
sip:james at 2600hz.com
tel: 415.886.7905
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the rabbitmq-discuss mailing list