[rabbitmq-discuss] load balancing for consummer
Ben Hood
0x6e6562 at gmail.com
Wed Aug 26 10:53:28 BST 2009
Benoît,
On Wed, Aug 26, 2009 at 9:23 AM, Benoit Chesneau<bchesneau at gmail.com> wrote:
>> 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.
>>
>
> socket is in the init. I guess that when the socket failed it didn't
> receive connexion so the gen_serv failed and supervisor tried to
> launch new instance then the error happend. I need to rethink that,
> I'm not sure actually how i could simply wait a new instance come up
> in the rabbitmq cluster.
Again, I'm not sure I completely follow.
This what the gen_server documentation says about the lifecycle of start_link/4:
"The gen_server process calls Module:init/1 to initialize. To ensure a
synchronized start-up procedure, start_link/3,4 does not return until
Module:init/1 has returned."
If the connection fails during init, then the process will be
terminated and hence will not be able to receive anything, least of
all any subscription callbacks.
Are you maybe trying to get a supervisor catch the failure in the
initialization and iterate through a list of known Rabbit hosts?
Ben
More information about the rabbitmq-discuss
mailing list