If you are using a PUB-SUB connection (which seems like you are describing), then the quick answer is no. Publishing a socket discards messages instead of their queue.
Even if you change the socket types to PUSH and PULL, you will still have problems. Yes, the PUSH socket will be blocked for messages not received, but since you will have another client connected, the message will be sent and thus will not be blocked if one of the clients falls. With PUSH-PULL types, you cannot “subscribe” to certain messages, as you can connect to PUB-SUB.
You can implement some logic to do what you describe. Checkout the zmq guide (second marker item) to see what they recommend for a reliable connection. What is being described is essentially a method for tracking messages that a client receives (by increasing the identifier?), And a second connection that the client can “request so that the missed messages are resent.”
The above section can also be implemented with the client to the heartbeat server, which gives the last message received. The server checks this to ensure that the client is not lagging behind and re-publishes messages, if any.
source share