[zeromq-dev] Fwd: autoreconnection / program start-up order

Aamir M intuitionist at gmail.com
Mon May 11 22:59:15 CEST 2009


Sorry, please ignore previous email. The autoreconnect DOES work, it was a
fault on my part.

---------- Forwarded message ----------
From: Aamir M <intuitionist at gmail.com>
Date: Mon, May 11, 2009 at 4:32 PM
Subject: autoreconnection / program start-up order
To: zeromq-dev at lists.zeromq.org


Hello All,
I have a number of servers running a "worker" program. Each "worker" binds a
local queue to a load-balancing global exchange. The load-balancing global
exchange is created by a central "controller" which sends work to the
"worker" programs.
In the "controller" program, the code looks like:

int eid = zmq_api->create_exchange( "WORK_E", zmq::scope_global,

"eth2:6666", exchange_thread, 1, &exchange_thread,

zmq::style_load_balancing );



On the "worker" side, the code looks like:

int qid = zmq_api->create_queue( "Q", zmq::scope_local,

 "eth1:6666", queue_thread, 1, &queue_thread);

zmq_api->bind( "WORK_E", "Q", queue_thread, queue_thread );


I have explicitly specified the network interface / port in both programs,
so I assume that the new 0MQ reconnection feature will work. I may be
mistaken, but I think for this use-case it makes sense for the "worker"
programs to have local 0MQ queues and the central 'controller" program to
have a global (load balanced) exchange. So far so good.

The problem is that I want to be able to start these programs in ANY order.
That is to say, I want to be able to start the "worker" program first (even
though it will encounter an error when it tries to bind to the global
exchange), and then start the "controller" program last (where it will
create the global exchange). I thought that the "worker" program would
automatically connect to the "controller" once it came online, but this
doesn't seem to be the case ... Is this how the library is supposed to
behave?

Thanks,
Aamir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090511/6b33ce84/attachment.htm>


More information about the zeromq-dev mailing list