# 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 System;
    using MassTransit;
    using Microsoft.Extensions.DependencyInjection;

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

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

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

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

WARNING

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