RabbitMQ
Manage message queues with RabbitMQ and its web interface.
- queue
- messaging
Guide: Connect to a database from outside
Run it
briq run rabbitmqbriq_run({ recipe: "rabbitmq", wait: true })curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipe": "rabbitmq",
"wait": true
}'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "AMQP_URL": "…" }, … }
# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
-H "Authorization: Bearer $BRIQ_API_KEY"stack: app
services:
rabbitmq:
recipe: rabbitmq
# its defaults, each a field you can set:
# image: rabbitmq:4-management-alpine
# size: small
# volume: { gb: 1 }Fields
| Name | Type | Options | Default |
|---|---|---|---|
| image | string | — | "rabbitmq:4-management-alpine" |
| env | record | { key: string | { secret, value?, literal?, scope?, hosts?, locations? } } | {} |
| cmd | string | string[] | — | — |
| size | enum | pico, micro, nano, small, medium, large, xlarge | "small" |
| volume | object | { gb? } | {"gb":1} |
| files | record | { key: string | { base64 } } | — |
| egress | object | { hosts } | — |
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 | 1 GB at /var/lib/rabbitmq |
When to use it
- Your services speak AMQP (Celery, MassTransit, amqplib, Spring AMQP) and need real acks, prefetch and dead-lettering.
- You want the management UI or HTTP API to inspect queues during a test.
Tips
- Boot takes 30 to 60 seconds on
small;briq_runwaits for it. - Declare exchanges and queues from code, so tests see what production sees.
- Inspect queues:
briq_execwith["rabbitmqctl", "list_queues", "name", "messages"]. - Workers outside briq:
briq_exposeport 5672 withprotocol: "amqp"gives anamqps://URL. See Connect to a database from outside. - Management UI for a human:
briq_run({ recipe: "rabbitmq", expose: "private" }). - Long queues: messages that outgrow memory go to the volume, which starts small; set
volume: { gb }for more. Set it when the briq is created, and it counts toward your plan's disk.