[zeromq-dev] [ask] MonitoredQueue Prefix

MinRK benjaminrk at gmail.com
Fri Aug 29 07:15:26 CEST 2014


On Thu, Aug 28, 2014 at 8:57 PM, bino oetomo <bino at indoakses-online.com>
wrote:

> Dear All ...
>
> I'm learning about monitor device based on
>
> http://learning-0mq-with-pyzmq.readthedocs.org/en/latest/pyzmq/pyzmqdevices/monitorqueue.html
>
> My script is at http://pastebin.com/3HvdCsHC
>
> Basically it have 4 Process :
> 1. Gate : This is the one that use MonitoredQueue. It have zmq.PULL at the
> frontend, zmq.PUSH at the backend, and zmq.PUB at the monitor port
> 2. monitor : this is the one that 'listen' the monitoring port of 'gate',
> and just print out what it heard
> 3. puller : this one just PULL data from 'gate' backend port, and just
> print out what it got
> 4. sender : This one just a simple payload pusher that push data to 'gate'
> frontend.
>
> --result snipet--
> MONITOR STARTED !
> PULLER STARTED
> Sender said : 1
> Monitor : ipc:///tmp/msock GOT : in
> PULLER Got : 1
> Monitor : ipc:///tmp/msock GOT : 1
> Sender said : 2
> PULLER Got : 2
> Monitor : ipc:///tmp/msock GOT : in
> Monitor : ipc:///tmp/msock GOT : 2
> Sender said : 3
> PULLER Got : 3
> Monitor : ipc:///tmp/msock GOT : in
> Monitor : ipc:///tmp/msock GOT : 3
> -------------------------
> Longer result at http://pastebin.com/7WZ1PW0U
>
> Looks like that monitor client always got 2 messages ... thats is :
> a. 'in prefix'
> b. real payload
>

It's not two messages, it is an extra frame on the front of a single
multipart message, similar to the IDENTITY frame on a ROUTER socket, or the
optional topic frame on PUB.


>
> My question is : Where and how to set so that monitor client only got 'the
> real payload' and get rid of 'prefixes' ?
>

I think you might want to use the vanilla Proxy instead of MonitoredQueue.
MQ was added to pyzmq a while before zmq_proxy was added to libzmq, and it
does a few things that the later proxy doesn't:

1. it adds a prefix frame, so monitors can identify which socket in the
device received the message
2. it supports ROUTER-ROUTER devices, which can be used as multiplexers

If you aren't interested in either one of those, then the plain proxy that
ships with libzmq is probably what you are after.

-MinRK


>
> Note : my pyzmq version is '14.1.1'
>
> Sincerely
> -bino-
>
> _______________________________________________
> 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/20140828/588bd398/attachment.html>


More information about the zeromq-dev mailing list