Skip to content

Idempotent Message Delivery

TIP

There is nothing you need to do to opt into idempotent, no more than once message deduplication other than to be using the durable inbox on any Wolverine listening endpoint where you want this behavior.

When applying the durable inbox to message listeners, you also get a no more than once, idempotent message delivery guarantee. This means that Wolverine will discard any received message that it can detect has been previously handled. Wolverine does this with its durable inbox storage to check on receipt of a new message if that message is already known by its Wolverine identifier.

Instead of immediately deleting message storage for a successfully completed message, Wolverine merely marks that the message is handled and keeps that message in storage for a default of 5 minutes to protect against duplicate incoming messages. To override that setting, you have this option:

cs
using var host = await Host.CreateDefaultBuilder()
    .UseWolverine(opts =>
    {
        // The default is 5 minutes, but if you want to keep
        // messages around longer (or shorter) in case of duplicates,
        // this is how you do it
        opts.Durability.KeepAfterMessageHandling = 10.Minutes();
    }).StartAsync();

snippet source | anchor

Released under the MIT License.