ZeroMQ:建立有效连接之前的内部排队策略

ZeroMQ: Internal queuing policy before having a valid connection

假设我有一个 inproc-PAIR 消息系统。在接收者连接到发送者之前,发送者已经绑定并立即开始发送消息。

现在,在连接成功之前,ZMQ是否会选择做以下其中一项:

我知道 ZMQ 有一个包含 1000 条消息的内部队列,并且通过 PubSub 了解到它会在绑定发生后立即发送消息,因此会丢失消息。但我不确定其他协议。

来自ZeroMQ documentation :

When a PAIR socket enters the mute state due to having reached the high water mark for the connected peer, or if no peer is connected, then any send operations on the socket will block until the peer becomes available for sending; messages are not discarded.

所以你的前两个选项是正确的;它会排队消息,直到您到达 hwm,然后阻止发件人。 它不是丢弃消息。