RabbitMQ
Convoy supports ingesting events from RabbitMQ queues. This is currently only supported in outgoing projects.
Before Connecting to RabbitMQ
To connect your RabbitMQ instance, you need to supply:
- The hostname and port of the RabbitMQ cluster (e.g., localhost:5672).
- The queue name from which to pull messages.
- The number of workers specifying the number of consumers polling messages from the queue.
- (Optional) Dead Letter Exchange (DLX), to route unprocessable messages to a specified exchange. Convoy does not declare this DLX.
- Virtual Host (vhost), where your queue and exchange are located.
- Username and password for authentication.
Bind Exchange (optional)
RabbitMQ queues can be bound to exchanges, enabling selective message routing based on a routing key. You can specify an exchange name and routing key to filter messages sent to your queue.
Authentication
Authentication is optional and can be set up using username and password if required. Additional configurations, such as SSL/TLS, can be enabled or disabled depending on your RabbitMQ setup.
Connecting to RabbitMQ
To set up RabbitMQ as an event source in Convoy, follow these steps:
Complete the RabbitMQ Source Form with the required details
This includes specifying:
- Hostname and Port
- Queue Name
- Number of Workers
- Virtual Host
- (Optional) Dead Letter Exchange (DLX) and authentication credentials
View the created RabbitMQ source in the sources list
After submitting, your new RabbitMQ source should appear in the list of event sources.
Ingestion Options
Convoy provides two ways to ingest events from RabbitMQ:
- Direct Payload Ingestion: Use the following payload structure as a guide for formatting:
If
x-convoy-message-type
is set to broadcast, the event is sent to all endpoints in the project, ignoring both theendpoint_id
andowner_id
values.
- Arbitrary Payload Transformation: For custom payload formats, use Convoy’s transform functions to modify the payload at the point of ingestion.
Things to Note
- Each worker reads messages one-by-one from the queue, with acknowledgments processed per message.
Was this page helpful?