Skip to content

Scheduled Delivery


This functionality as introduced in Wolverine 1.6.0

WolverineFx.AzureServiceBus now supports native Azure Service Bus scheduled delivery. There's absolutely nothing you need to do explicitly to enable this functionality.

So for message types that are routed to Azure Service Bus queues or topics, you can use this functionality:

public async Task SendScheduledMessage(IMessageContext bus, Guid invoiceId)
    var message = new ValidateInvoiceIsNotLate
        InvoiceId = invoiceId

    // Schedule the message to be processed in a certain amount
    // of time
    await bus.ScheduleAsync(message, 30.Days());

    // Schedule the message to be processed at a certain time
    await bus.ScheduleAsync(message, DateTimeOffset.Now.AddDays(30));

snippet source | anchor

And also use Azure Service Bus scheduled delivery for scheduled retries (assuming that the listening endpoint was an inline Azure Service Bus listener):

using var host = Host.CreateDefaultBuilder()
    .UseWolverine(opts =>
            // Just retry the message again on the
            // first failure

            // On the 2nd failure, put the message back into the
            // incoming queue to be retried later

            // On the 3rd failure, retry the message again after a configurable
            // cool-off period. This schedules the message

            // On the next failure, move the message to the dead letter queue


snippet source | anchor

Released under the MIT License.