Skip to content

Delayed Messages

Mogens Heller Grabe edited this page Oct 20, 2023 · 4 revisions

When you enable the Fleet Manager plugin in your Rebus instance(s), you have the additional option of enabling the use of Fleet Manager as the "timeout manager", i.e. the thing that stores messages to be delivered at a later time.

This is done by calling the additional .Timeouts(t => t.StoreInFleetManager()) configuration extension like so:

services.AddRebus(
    configure => configure
        .(...)
        .Options(o => o.EnableFleetManager(...))
        .Timeouts(t => t.StoreInFleetManager())
);

Even though some transports (like Azure ServiceBus, Amazon SQS, ...) have this capability natively, using Fleet Manager to store deferred messages has the added benefit that the messages become visible and can be inspected.

⚠️ It has a downside too, though: It's nowhere nearly as performant as the native message delay mechanisms built into the transports, so you probably don't want to use it, if you need to schedule 100s or 1000s of messages to be delivered at about the same time.

In other words: Use Fleet Manager as the timeout manager, when you need to schedule a limited number of messages to be delivered, e.g. < 100 within each couple of minutes, and you want to be able to see them in Fleet Manager.

Clone this wiki locally