Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What reliability guarantees (if any) does ZMQ make for PUB/SUB over epgm?

Tags:

zeromq

I've got an app sending messages on an epgm PUB socket to one or more epgm SUB sockets. Things mostly work, but if a subscribing application is left up long enough, it will generally end up missing a message or a few messages. (My messages have sequence numbers, so I can tell if any are missing or out of order.) Based on my reading of the ZMQ docs, I would have thought that the "reliable multicast" nature of epgm would prevent this from happening, that after a SUB socket gets one message, it's guaranteed to keep getting them until shutdown or until major network troubles (ie, the connection is maxed out).

Anyway, that's the context, but the question is simply the title: What reliability guarantees (if any) does ZMQ make for PUB/SUB over epgm?

like image 679
scott Avatar asked Apr 04 '13 15:04

scott


People also ask

Does ZeroMQ guarantee delivery?

ZeroMQ guarantees to deliver all the parts (one or more) for a message, or none of them. This allows you to send or receive a list of frames as a single on-the-wire message. A message (single or multipart) must fit in memory.

What is ZMQ pub sub?

Pub/Sub is a pattern where the publisher is not programmed to send a message (payload) to a specific receiver. These messages are sent by publishers to specific channels, and receivers can subscribe to one or more channels to consume those same messages.

How do I know if my ZMQ socket is connected?

No, there's no method in the API to check if a socket is connected. ZeroMq abstracts the network; client and server connections are completely transparent to the peer making the connection.

What is ZMQ context?

ZMQ. Context Context is an object serving as a container for all the sockets of a single process. By creating a new context, you start one or more input/output threads: DEFINE context ZMQ.Context. Associated methods: socket()


1 Answers

ZeroMQ makes exactly one guarantee: all messages are complete - you will never receive partial messages. It makes no guarantee of reliability. You should check out the documentation of the high water mark (HWM) behavior, which is the most common cause for dropped messages, as illustrated by the suicidal snail.

like image 133
minrk Avatar answered Oct 16 '22 06:10

minrk