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

Martin Sustrik sustrik at fastmq.com
Mon May 11 22:59:45 CEST 2009


Hi Aamir,

> 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?

To start components in any order zmq_server have to be aware of them in 
advance. To inform it about location components you can feed it with a 
config file; for details have a look here:

http://www.zeromq.org/local--files/area:docs-v06/zmq_server.pdf

Two comments:

1. If you specify location of a global object via config file you don't 
have to fill it in when calling create_queue/create_exchange function.

2. When creating a local object, you don't have to specify location and 
threads. Something like this would do: api->create_queue ("Q", scope_local);

Hope this helps.
Martin



More information about the zeromq-dev mailing list