[rabbitmq-discuss] Erlang client and supervision trees

Ben Hood 0x6e6562 at gmail.com
Fri Sep 19 13:22:37 BST 2008


(Hope you don't mind that I'm cc'ing the Rabbit list)

I've given your question about how to integrate a supervision tree
into the Erlang client some consideration.

If you want to supervise your AMQP consumers in a tree, you could pass
a reference to the existing connection, an existing channel or a new
channel into the start function of the child specification.

However, this may not help you when a consumer dies. Sure, depending
on the strategy, you could get the supervisor to start a new worker,
but AFAIK there is no callback in which you could perform any
housekeeping (e.g. unsubscribing a dead consumer).

So you may want to use a monitor to keep track of this.

Be aware that the client does not monitor any consumers or perform any
cleanup - the client is simply a mouthpiece to the server, it does not
maintain your application for you.

If you are interested in OTP best practices on this topic, it may be
an idea to start a thread on the erlang questions list to get a more
general perspective.



More information about the rabbitmq-discuss mailing list