Publish from RabbitMQ
This guide provides information on using RabbitMQ to publish events to Outpost.
Message Structure
RabbitMQ messages should have the same payload structure as the Publish API endpoint.
{
"tenant_id": "<TENANT_ID>",
"destination_id": "<DESTINATION_ID>", // Optional. Provide a way of routing events to a specific destination
"topic": "topic.name", // Topic defined in TOPICS environment variable
"eligible_for_retry": true | false, // Should event delivery be retried? Default is true.
"metadata": Payload, // can be any JSON payload,
"data": Payload // can be any JSON payload
}
Configuration
Provide Outpost with connection and routing information for your RabbitMQ instance used for publishing events.
Environment Variables
PUBLISH_RABBITMQ_SERVER_URL="<SERVER_URL>"
PUBLISH_RABBITMQ_EXCHANGE="<EXCHANGE_NAME>"
PUBLISH_RABBITMQ_QUEUE="<QUEUE_NAME>"
Example
PUBLISH_RABBITMQ_SERVER_URL="amqp://guest:guest@localhost:5673"
PUBLISH_RABBITMQ_EXCHANGE="outpost"
PUBLISH_RABBITMQ_QUEUE="publish"
YAML
publishmq:
publishmq:
rabbitmq:
server_url: <SERVER_URL>
exchange: <EXCHANGE_NAME>
queue: <QUEUE_NAME>
Example
publishmq:
rabbitmq:
server_url: amqp://guest:guest@localhost:5673
exchange: outpost
queue: publish