You’ll already be using a message broker that supports at least one delivery. At least once delivery guarantees that a message will be delivered once or more that you have the same message that could be delivered to a consumer possibly multiple times.

Duplicate messages could have some very negative impacts on your system. For example, an order being places twice.

In this article, we are going to understand why do duplicate messages occur and how do we deal with them.

Let’s start talking about delivery guarantees.

  • At Most Once
  • At Least Once
  • Exactly Once

Message brokers don’t all support this, they generally support probably one or two but they are at most once and this means is that a message will get delivered to a consumer maybe once. This means that it might not at all or most it will get delivered once.

There’s also at least once and probably what you’re going to pick a message broker that supports and that means again that a message will get delivered guaranteed at least once but it could get delivered more than once.

#outbox-pattern #asynchronous #microservices

Outbox Pattern — Avoid Duplicate Messages
1.30 GEEK