Acknowledgement

Consider this situation: a Consumer gets a message (m1) but before it can act on it, the message crashes (or restarts). Hence, m1 is not fully consumed, but from the perspective of the Broker, it's already delivered. This can be better understood with the following diagram:

To handle such situations, Broker typically has facilities to allow consumers to acknowledge messages. Once a message is delivered, the Broker temporarily removes it from the queue and puts it in some other cold storage. The Consumer is supposed to send an acknowledgement for each message it consumes. When an acknowledgement for a message is received, it is removed from the cold storage by the Broker. Also, when sending a message to a Consumer, the Broker starts a timer for the acknowledgement deadline. If this time expires, the Broker assumes that the Consumer died while processing and moves the message from cold storage to the queue.

Does this enable reliable consumption? The acknowledgement model enables three types of reliable message delivery semantics, which we'll look at now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset