[zeromq-dev] zmq_msg_get('User-Id') on XPUB subscribe/unsubscribe messages raises Invalid argument exception (pyzmq)

Tomas Krajca tomas at repositpower.com
Tue Oct 28 03:53:09 CET 2014


I am not sure whether this is a bug or just has not been implemented for 
XPUB sockets. Basically, I use zmq authentication - SUB socket is my 
client, XPUB is my server - and I would like to see who subscribed to my 
XPUB server. When I try to get a User-Id from the subscribe/unsubscribe 
messages, I get Invalid argument exception. If I do the same for DEALER 
- DEALER, everything works.

I use pyzmq 14.4.0 with libzmq 4.1.0 rc1.

Python exception:

Set up authenticator
Set up server
Set up client
DEBUG:zmq.auth:version: '1.0', request_id: '1', domain: u'', address: 
u'', identity: '', mechanism: 'CURVE'
DEBUG:zmq.auth:ALLOWED (CURVE allow any client)
DEBUG:zmq.auth:ZAP reply code=200 text=OK
Auth authenticated
[<zmq.sugar.frame.Frame object at 0x10b4ec0>]
Traceback (most recent call last):
   File "test2.py", line 64, in <module>
     print "User-Id: ", smsg[-1].get('User-Id')
   File "zmq/backend/cython/message.pyx", line 375, in 
zmq.backend.cython.message.Frame.get (zmq/backend/cython/message.c:3398)
   File "zmq/backend/cython/checkrc.pxd", line 21, in 
zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/message.c:3979)
zmq.error.ZMQError: Invalid argument

Corresponding code is at http://pastebin.com/v6Jm55WK


More information about the zeromq-dev mailing list