Skip to content

b13/ddev-rabbitmq

Repository files navigation

RabbitMQ

This enables a RabbitMQ service container that can be used by other containers on the same network and the host machine itself.

Installation

For DDEV v1.23.5 or above run

ddev add-on get b13/ddev-rabbitmq && ddev restart

For earlier versions of DDEV run

ddev get b13/ddev-rabbitmq && ddev restart

Configuration

From within the container, the RabbitMQ container is reached at hostname: rabbitmq on port 5672, so the server URL will be amqp://rabbitmq:5672.

For more details check the connection section below.

YAML configuration

The config.rabbitmq.yaml describes vhosts, queues, users, and plugins.

The configuration can be applied with the following command:

ddev rabbitmq apply

⚠️ This may not cover all possible configuration values! But it is a good start.

Remove rabbitmq configuration but keep default user (rabbitmq) and vhost (/):

ddev rabbitmq wipe

Commands

Everything possible in Management UI can be done using rabbitmqadmin. User and password are set

ddev rabbitmqadmin --help

rabbitmqctl is used to manage the cluster and nodes

ddev rabbitmqctl --help

ℹ️rabbitmqadmin and rabbitmqctl share a some functions. Both are needed for full configuration.

Connection

RabbitMQ is accessible from the host machine itself as well as between the containers on the same network, and comes with a nice management UI for ease of use.

Management UI

The management UI can be accessed through https://<DDEV_SITENAME>.ddev.site:15673 on the host machine. Username: "rabbitmq", password: "rabbitmq". This is also shown in ddev describe.

For more information about the HTTP API see the official documentation

AMQP protocol access

You can access the RabbitMQ service through its AMQP protocol inside any DDEV container via amqp://rabbitmq:5672

Examples:

Originally Contributed by @Graloth in ddev-contrib

Maintained by @b13