I am studying the message delivery guarantee in ZeroMQ, if it ensures exactly-once message delivery.
The classic method is to keep the message number and client ID at the receiving node, and each time a message received should be compared with the log to check if the message is already received.
In ZeroMQ (0MQ) guide, chapter 4:
"To handle non-idempotent operations, use the fairly standard solution of detecting and rejecting duplicate requests. This means:
- The client must stamp every request with a unique client identifier and a unique message number.
- The server, before sending back a reply, stores it using the combination of client ID and message number as a key.
- The server, when getting a request from a given client, first checks whether it has a reply for that client ID and message number. If so, it does not process the request, but just resends the reply."
I want to know the type of the log ZeroMQ saves the messages and client IDs into it (Vector, map, array...), and for how much time it keeps the state for each client (ID, messages..).
Is there a timeout to remove the client information? After removing the information of a specific client, what if an old duplicate message was received?