RabbitMQ
Message broker for queues and messaging
Reliable message broker for handling queues, background jobs, and distributed messaging using RabbitMQ management Alpine.
Docker Configuration
Image: rabbitmq:management-alpine
Ports:
- 5672:5672 # AMQP
- 15672:15672 # Management UI
Volume: damp-rabbitmq:/var/lib/rabbitmqDAMP identifies the service using Docker labels. Container name is auto-generated by Docker.
Port Configuration
Default ports:
- AMQP:
5672(host) →5672(container) - Management UI:
15672(host) →15672(container)
If either port is occupied on the host machine, DAMP automatically uses the next available port. Check the DAMP interface to see the actual ports assigned.
Environment Variables
| Variable | Value | Description |
|---|---|---|
RABBITMQ_DEFAULT_USER | rabbitmq | Admin username |
RABBITMQ_DEFAULT_PASS | rabbitmq | Admin password |
Connection Information
From Host Machine (Windows)
Management Console:
http://localhost:15672Login:
- Username:
rabbitmq - Password:
rabbitmq
AMQP Protocol:
amqp://rabbitmq:rabbitmq@localhost:5672From Project Containers
Use the container name or ID shown in the DAMP interface.
AMQP Protocol:
amqp://rabbitmq:rabbitmq@[container-name]:5672Replace [container-name] with the actual container name displayed in DAMP.
Laravel Queue Configuration
Install AMQP Extension
# In devcontainer
pecl install amqpInstall Laravel Package
composer require vladimir-yuldashev/laravel-queue-rabbitmqConfigure .env
QUEUE_CONNECTION=rabbitmq
RABBITMQ_HOST=[container-name]
RABBITMQ_PORT=5672
RABBITMQ_USER=rabbitmq
RABBITMQ_PASSWORD=rabbitmq
RABBITMQ_VHOST=/
RABBITMQ_QUEUE=defaultReplace [container-name] with the actual container name displayed in DAMP.
Dispatch Jobs
use App\Jobs\ProcessOrder;
// Dispatch to queue
ProcessOrder::dispatch($order);
// Run queue worker
php artisan queue:work rabbitmqManagement Console Features
- Overview of connections, channels, and queues
- Create, view, and purge queues
- Routing configuration via exchanges
- View active connections
- Monitor message rates and memory usage
Common Operations
Create Queue via PHP
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage;
// Use container name from DAMP
$connection = new AMQPStreamConnection(
'[container-name]', 5672, 'rabbitmq', 'rabbitmq'
);
$channel = $connection->channel();
$channel->queue_declare('task_queue', false, true, false, false);
$msg = new AMQPMessage('Hello World!');
$channel->basic_publish($msg, '', 'task_queue');Use Cases
- Background jobs like email sending and report generation
- Task distribution and load balancing across workers
- Event broadcasting and pub/sub messaging
- Service-to-service communication in microservices
- Event tracking and analytics processing
Messages survive container restarts - jobs are safe in the damp-rabbitmq volume.
Monitoring
Access real-time metrics at http://localhost:15672:
- Message rates (publish/deliver)
- Queue depths
- Consumer count
- Memory usage
Data Persistence
All queues and messages are stored in the damp-rabbitmq Docker volume. Removing the service preserves your data.