The ZMQ_IDENTITY option shall set the identity of the specified socket when connecting to a ROUTER socket. The identity should be from 1 to 255 bytes long and may contain any values.If two clients use the same identity when connecting to a ROUTER, the results shall depend on the ZMQ_ROUTER_HANDOVER option setting. If that is not set (or set to the default of zero), the ROUTER socket shall reject clients trying to connect with an already-used identity. If that option is set to 1, the ROUTER socket shall hand-over the connection to the new client and disconnect the existing one.
|Option value type||binary data|
|Option value unit||N/A|
|Applicable socket types||ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER.|
The documentation for a ROUTER socket says: “When receiving messages a ZMQ_ROUTER socket shall prepend a message part containing the identity of the originating peer to the message before passing it to the application.”
When our bound endpoint goes down, it drops currently pending requests to a text file.
When we boot a new one, it can read these files, but it can’t identify the client in question because the identifier was unique to the previous socket. It has no concept of who this “008000002D” client is (or sends it to a new client it has identified with this tag).
The question is, can we force a ROUTER socket to use a unique identity provided by the client instead of making one up on its own?
Tempus Technologies, Inc.
zeromq-dev mailing list