[zeromq-dev] obtain generated identity of socket

Justin Karneges justin at affinix.com
Mon Sep 24 21:42:30 CEST 2012


Hi,

I'm using ROUTER<->ROUTER connections for one-way communication. How can the 
sending peers identify the destination peers? Currently I'm generating peer 
ids and telling the senders out of band (using a different socket), but the 
destination ROUTER sockets are not yet aware of these ids, so messages don't 
get delivered. I think I could use ZMQ_IDENTITY to set my generated ids on the 
destination ROUTER sockets, yes? The sending peers use the envelope format, 
where the first part of each message is the destination peer id.

I recall reading somewhere that setting ZMQ_IDENTITY was being discouraged, 
but maybe that was only in the context of durability? Is there a way for me to 
create a ROUTER socket and then ask it for its generated id, instead of me 
making one? The docs seem to indicate that by default the socket would have no 
identity, so I'm not sure if reading the default ZMQ_IDENTITY value is what I 
want.

Justin



More information about the zeromq-dev mailing list