cookbook / rabbitmq
RabbitMQ
AMQP message broker with the management UI enabled.
- queue
- messaging
Run it
briq_run({
recipe: "rabbitmq",
params: {
"version": "4",
"size": "small"
},
wait: true
})briq run rabbitmq
briq ls
briq logs -f <id>
briq rm <id>import { Briq } from '@briq/sdk';
const briq = new Briq(process.env.BRIQ_API_KEY);
const rabbitmq = await briq.run({
recipe: 'rabbitmq',
params: {
"version": "4",
"size": "small"
},
});
console.log(rabbitmq.outputs.AMQP_URL);
// ... when done
await briq.destroy(rabbitmq.id);Parameters
| Name | Type | Options | Default |
|---|---|---|---|
| version | enum | 3.13, 4 | "4" |
| size | enum | nano, small, medium, large | "small" |
Outputs
Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.
- AMQP_URL
- amqp://app:<RABBITMQ_PASSWORD>@rabbitmq.<stack>.internal:5672
- RABBITMQ_MANAGEMENT
- http://rabbitmq.<stack>.internal:15672
- RABBITMQ_USER
- app
- RABBITMQ_PASSWORD
- <RABBITMQ_PASSWORD>
What it runs
| Briq | Image | Ports | Size | Volume |
|---|---|---|---|---|
| rabbitmq | rabbitmq:4-management-alpine | 5672, 15672 | small | 5 GB at /var/lib/rabbitmq |
When to use it
- Your services talk AMQP (Celery, MassTransit, amqplib, Spring AMQP) and you want a broker with real acknowledgements, prefetch and dead-lettering.
- You need the management UI or HTTP API to inspect queues during a test.
Outputs give you AMQP_URL for the app user and RABBITMQ_MANAGEMENT for the UI on port 15672.
Tips
- Boot takes a while. The healthcheck (
rabbitmq-diagnostics ping) can take 30 to 60 seconds on asmallbriq.wait: truehandles it. - Declare from code, not by hand: exchanges and queues declared by your consumers are the same ones your tests will see.
- Inspect with the HTTP API.
briq_execwithcurl -u app:$RABBITMQ_PASSWORD http://localhost:15672/api/queueslists queues with message counts. - Versions 3.13 and 4 (default), both with the management plugin.