[rabbitmq-discuss] load balancing for consummer

Ben Hood 0x6e6562 at gmail.com
Wed Aug 26 00:18:42 BST 2009


Benoît,

On Tue, Aug 25, 2009 at 8:37 PM, Benoit Chesneau<bchesneau at gmail.com> wrote:
> i use ?MODULE to catch message at handle_info level. Would you suggest
> another method ? Also I'm not sure I'm right to do it especially if I
> want to catch cases where socket is closed. What is the best practice
> about it ?

I think I was confused by registration name of the gen_server
instance. Your gen_server registers itself as couchdbbot_consumer, so

couchdbbot_consumer ! msg

would resolve the pid of your gen_server instance.

However, the atom you use to subscribe to the queue is ?MODULE (which
would preprocess to bot_consumer) which wouldn't resolve to a pid.

So I was wondering where the magic occurs, that's all.

Having said that, I am actually wondering whether we're speaking about
the same thing. The process that is subscribed to queue will only get
3 types of messages from the amqp_channel process, namely
basic.consume_ok, basic.cancel_ok and basic.deliver. I don't see where
the socket exceptions are going to come from.

Ben

PS Please try to keep the discussion on list, as other people will be
able to help as well :-)




More information about the rabbitmq-discuss mailing list