# RabbitMQ

MassTransit uses the RabbitMQ delayed exchange plug-in to schedule messages.

Quartz.NET Docker Image

MassTransit provides a Docker Image with RabbitMQ ready to run, including the delayed exchange plug-in.

# Configuration

To configure the delayed exchange message scheduler, see the example below.

namespace SchedulingRabbitMQ
{
    using System;
    using MassTransit;
    using Microsoft.Extensions.DependencyInjection;

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

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

                x.UsingRabbitMq((context, cfg) => 
                {
                    cfg.UseDelayedExchangeMessageScheduler();

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

WARNING

Scheduled messages cannot be canceled when using the delayed exchange message scheduler.