Mock RabbitMQ Message Generator
Generates fake message-queue payloads with routing metadata for testing
Generated 34 words · 505 characters
See 3 examples
- Example 1
{ "exchange": "scheduling", "routing_key": "appointment.reminder_due", "properties": { "message_id": "bee0e33b66d0c4ef", "correlation_id": "0e9b85ab-b94a-45a0-854b-0a37948db890", "content_type": "application/json", "delivery_mode": 2, "timestamp": 1724713432 }, "payload": { "id": 7671528, "type": "appointment.reminder_due", "occurred_at": "2024-08-26T23:02:39Z", "appointment_id": "apt_1572e2de1a7e", "channel": "sms", "starts_in_minutes": 120 } } - Example 2
{ "exchange": "jobs", "routing_key": "cron.tick", "properties": { "message_id": "8474d821ecee9a8b", "correlation_id": "5e89d34f-9b9a-4ef0-a562-3f7dc7eaade5", "content_type": "application/json", "delivery_mode": 2, "timestamp": 1782151816 }, "payload": { "id": 5868748, "type": "cron.tick", "occurred_at": "2026-06-22T18:09:36Z", "schedule": "0 9 * * 1", "task": "sync_rates", "scheduled_for": "2026-06-22T18:11:08Z" } } - Example 3
{ "exchange": "notifications", "routing_key": "email.bounced", "properties": { "message_id": "270420336051069e", "correlation_id": "0adbee4f-6939-4960-af50-a51485ae0ae3", "content_type": "application/json", "delivery_mode": 2, "timestamp": 1765221047 }, "payload": { "id": 8130391, "type": "email.bounced", "occurred_at": "2025-12-08T19:09:00Z", "message_ref": "msg_f411983f7a3f", "to": "tomas.tanaka33@example.com", "bounce_type": "hard", "smtp_code": 450 } }
About this generator
When building or testing a RabbitMQ consumer, you need realistic message fixtures — not just a bare payload, but the full envelope that includes routing metadata. Without that, your consumer tests miss the exchange, routing key, and properties your real code depends on. This tool generates a single RabbitMQ-style message as a JSON object with no inputs required. The generated message includes an exchange (one of 22 domain exchanges such as orders, payments, users, inventory, shipping, billing, notifications, and iot), a routing_key (one of 93 dotted event names that belong to that exchange, like order.created, payment.failed, stock.low, or shipment.delivered), a properties block with message_id (random 16-char hex), correlation_id (a uuid), content_type, delivery_mode (2, meaning persistent), and a Unix timestamp — and a payload object with an id, a type matching the routing key, an occurred_at time, and the fields that event would really carry: order and customer ids, amounts with a currency, SKUs and quantities, failure codes, tracking numbers, and so on. Copy the JSON into a test case, feed it to a mock consumer, or paste it into consumer logic to see how it parses the envelope. Adapt the exchange, routing key, and payload schema to your own system.
How to use
- Click Generate to produce a queue message.
- Copy the JSON into a test or mock queue.
- Use it to exercise a consumer.
- Adapt the routing and payload to your system.
Use Cases
- •Testing a message consumer
- •Building a mock queue
- •Learning message-queue structure
- •Seeding sample messages
- •Demoing async messaging
Tips
- →Messages carry routing metadata.
- →The routing key directs delivery.
- →delivery_mode 2 means persistent.
- →Adapt the payload to your system.
FAQ
what fields does the generated message contain
The top level has exchange, routing_key, and properties (with message_id, correlation_id, content_type, delivery_mode: 2, and a timestamp), plus a payload object with id, type (matching the routing key), occurred_at, and event-specific fields — for example order_id, total, and currency for order.created, or failure_code and attempt for payment.failed. All ids and values are randomly generated.
what does delivery_mode 2 mean
A delivery_mode of 2 marks the message as persistent, meaning RabbitMQ will write it to disk so it survives a broker restart. A value of 1 means transient — the message lives only in memory. For anything that must not be lost (orders, payments), persistent mode is the right choice.
what is a routing key and how does it work
A routing key is a label on a message (like order.created) that a RabbitMQ exchange uses to decide which bound queues should receive it. Topic exchanges support wildcard patterns (order.* or #.failed), letting consumers subscribe to subsets of events. The generated keys follow the dotted-noun-verb pattern common in practice.
can I use this to test a real rabbitmq consumer
You can use the JSON structure to build test fixtures or mock the message object your consumer receives. The format mirrors the envelope metadata a real broker attaches, so your consumer parsing and routing logic can be exercised. For full integration testing, publish the message through a real broker in a test environment.
You might also like
Popular tools from other categories that share themes with this one.