[zeromq-dev] ROUTER-DEALER zmq_proxy Question.

Pieter Hintjens ph at imatix.com
Thu Mar 5 10:21:08 CET 2015


The messages are queued in the sockets, so your default capacity is
the total of the HWMs down to the receiver.

You can look at the proxy code; it is a simple read/write loop. For
anything non-trivial you generally end up writing your own code for
this layer.

On Wed, Mar 4, 2015 at 10:08 PM, Riskybiz <riskybizlive at live.com> wrote:
> Reading the zeromq api docs I see that a zmq_proxy can be used as a shared
> queue.
>
>
>
> ‘Shared queue
>
> When the frontend is a ZMQ_ROUTER socket, and the backend is a ZMQ_DEALER
> socket, the proxy shall act as a shared queue that collects requests from a
> set of clients, and distributes these fairly among a set of services.
> Requests shall be fair-queued from frontend connections and distributed
> evenly across backend connections. Replies shall automatically return to the
> client that made the original request.’
>
>
>
>
>
> I have a few (simple) questions on zmq_proxy which I hoped someone might be
> able to answer;
>
>
>
> 1.    What is the maximum size of a zmq_proxy queue, what is its capacity
> for storing queued messages; is it related to the high-water-mark settings
> of the constituent sockets?  Or is it able to grow to any size limited only
> by available memory.  Or something else entirely?
>
>
>
> 2.    How fast does a zmq_proxy run and process messages; does it run as
> fast as possible in its thread? Does it poll at intervals and then sleep for
> a period? Does it somehow respond to load and throttle up and down as
> necessary?
>
>
>
> 3.    Just to clarify before I start coding J: Is a ROUTER-DEALER zmq_proxy
> a bidirectional queue?  What I’m considering is this;
>
>
>
> A ROUTER-DEALER zmq_proxy with a set of clients communicating with the
> zmq_proxy ROUTER socket and an answering service using the zmq_proxy DEALER
> socket.
>
>
>
> Could the answering service pull an inbound queued message off the zmq_proxy
> DEALER socket; process it, catch the identity of the originator client,
> create a response, prepend the identity and then send the response back
> through the same zmq_proxy DEALER socket and have it routed back to the
> correct originating client?  i.e. Both inbound and outbound queues would
> conceptually be built into a single ROUTER-DEALER zmq_proxy?
>
>
>
> With thanks,
>
>
>
> Riskybiz.
>
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list