# Amazon SQS

Amazon SQS includes a DelaySeconds property, which can be used to defer message delivery. MassTransit uses this feature to provide scheduled message delivery.

# Configuration

To configure the Amazon SQS message scheduler, see the example below.

namespace SchedulingAmazonSQS;

using MassTransit;
using Microsoft.Extensions.DependencyInjection;

public class Program
{
    public static void Main()
    {
        var services = new ServiceCollection();

        services.AddMassTransit(x =>
        {
            x.AddDelayedMessageScheduler();

            x.UsingAmazonSqs((context, cfg) =>
            {
                cfg.UseDelayedMessageScheduler();

                cfg.ConfigureEndpoints(context);
            });
        });
    }
}

WARNING

Scheduled messages cannot be canceled when using the Amazon SQS message scheduler