[zeromq-dev] Configuration help requested

Larry White ljw1001 at gmail.com
Fri Mar 6 18:34:05 CET 2015

Hi Kenneth, Thank you. Some comments/questions below.

On Fri, Mar 6, 2015 at 11:59 AM, Kenneth Adam Miller <
kennethadammiller at gmail.com> wrote:

> What if instead of sending from the tail, you just used a push socket that
> the head could wait on in a loop. The REP socket could send a reply to the
> client immediately after having received from the tail on a pull socket. In
> this way, you still get what you want, and don't have to deal with the idea
> of maintaining addresses to send to the tail in order that they be sent to
> the right destination.

i think this might work, but seems as complex as forwarding the addresses.
I guess I was under the impression that this kind of forwarding loop
architecture was straightforward in ZeroMQ.

> Another cool idea that might be of interest to you is the idea that
> mutiple requests can be concurrently processed in the chain, with the head
> accepting and forwarding as many as can be read on the socket. In this way,
> the entire system isn't waiting as I implied above; you have higher
> throughput this way, because that's less time spent doing nothing but
> waiting. In any case, I think the way to do this would be to use a router
> socket at the head, and forward the address from the original client around
> through your chain. When that address gets back use it to send on the
> router socket.
> This is why I was using the PUSH socket between links. If I understand
these sockets correctly, a link can work as quickly as possible, push work
for the next link, then start working on its next request.  This should
maximize the throughput of the chain, I think, as the only thing that's
blocking are the clients.

> On Fri, Mar 6, 2015 at 11:47 AM, Larry White <ljw1001 at gmail.com> wrote:
>> Hi,
>> I'm trying to implement "chain replication" using 0MQ, and need help
>> configuring the system.
>> In chain replication, you have n clients and a sequence of server
>> replicas. The replicas are updated in order from HEAD to TAIL.  A three
>> link chain works in a loop like this:
>> 1. CLIENT sends write request to HEAD
>> 2. HEAD processes request and forwards to MIDDLE (No reply to client)
>> 3. MIDDLE processes request and forwards to TAIL
>> 4. TAIL processes request and sends a reply back to CLIENT.
>> I would like the interaction between CLIENT and the chain to be
>> synchronous (blocking), so that the client waits until it receives the
>> reply from TAIL.
>> I tried to set this up with head having a REP socket for client and a
>> PUSH socket for the chain. This causes an exception (obvious in hindsight)
>> that says
>> java.lang.IllegalStateException: Cannot receive another request
>> What is the correct way to do structure the relationship between Client
>> and Head?
>> Thank you very much for your help.
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150306/bcfb0c46/attachment.htm>

More information about the zeromq-dev mailing list