Message Delivery: Idempotent Messages
Learn about idempotent message delivery for ensuring exactly-once processing through deduplication and database transactions.
We'll cover the following
Idempotent message delivery
Not every application will be able to deploy the infrastructure to have exactly-once message delivery and others will not need it. When most people think of exactly-once delivery, what comes to their mind is exactly-once processing of messages. This goal of exactly-once processing of messages can be achieved by adding deduplication to at-least-once delivery.
The most common technique is to deduplicate the receipt of the message using the identity of the message. Using the messaging library or middleware, the identity for the message is checked against a list of already received and processed message identities. If the identity already exists, then the message is acknowledged and discarded. If the identity is not found, then the request continues to message processing. The process is illustrated in the following diagram:
Get hands-on with 1400+ tech skills courses.