Sign inSign up

cilerler/rabbitmq

By cilerler

Updated 10 months ago

RabbitMQ image with delayed message exchange plugin pre-installed

Image
0

263

cilerler/rabbitmq repository overview

RabbitMQ with Delayed Message Exchange Plugin

Custom RabbitMQ image with the delayed message exchange plugin pre-installed.

Base Image

docker.io/library/rabbitmq:4.2.1-management

Plugin

The rabbitmq_delayed_message_exchange plugin (v4.2.0) is included but not enabled by default. This allows developers to opt-in when needed.

Enable the Plugin
rabbitmq-plugins enable rabbitmq_delayed_message_exchange

Or via docker-compose.yml:

services:
  rabbitmq:
    image: cilerler/rabbitmq:4.2.1-management-delayed
    command: >
      bash -c "rabbitmq-plugins enable rabbitmq_delayed_message_exchange && rabbitmq-server"

Usage

Once enabled, declare an exchange with type x-delayed-message:

channel.ExchangeDeclare(
    exchange: "my-delayed-exchange",
    type: "x-delayed-message",
    durable: true,
    arguments: new Dictionary<string, object>
    {
        { "x-delayed-type", "direct" }
    });

Publish messages with the x-delay header (milliseconds):

var properties = channel.CreateBasicProperties();
properties.Headers = new Dictionary<string, object>
{
    { "x-delay", TimeSpan.FromSeconds(5) }
};

channel.BasicPublish(
    exchange: "my-delayed-exchange",
    routingKey: "my-routing-key",
    basicProperties: properties,
    body: messageBody);

Limitations

  • Delayed messages are stored in Mnesia with a single disk replica
  • Designed for delays of seconds, minutes, or hours—not days or weeks
  • Messages are lost if the node goes down or the plugin is disabled before delivery

See the official documentation for details.

Tag summary

Content type

Image

Digest

sha256:06ff5ad88

Size

119.5 MB

Last updated

10 months ago

docker pull cilerler/rabbitmq:management-delayed