Mock RabbitMQ Message Generator
Generates fake message-queue payloads with routing metadata for testing
Generated 26 words · 311 characters
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 exchange (one of events, orders, or notifications), routing_key (one of five event patterns: order.created, user.registered, payment.failed, email.queued, job.completed), a properties block with message_id (random 16-char hex), content_type, delivery_mode (2, meaning persistent), and a Unix timestamp — and a payload object with an id, type (matching the routing key), and a status of ok, pending, or retry. 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, content_type, delivery_mode: 2, and a timestamp), plus a payload object with id, type (matching the routing key), and status. 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.