Destinations

RabbitMQ

Send events to a RabbitMQ exchange via AMQP.

Configuration

Config

FieldTypeRequiredDescription
config.server_urlstringYesRabbitMQ server URL (host)
config.exchangestringYesExchange name
config.tlsstringNoEnable TLS (true or false, default: false)

Credentials

FieldTypeRequiredDescription
credentials.usernamestringYesRabbitMQ username
credentials.passwordstringYesRabbitMQ password

Example

curl --location 'https://<OUTPOST_API_URL>/api/v1/<TENANT_ID>/destinations' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <API_KEY>' \ --data '{ "type": "rabbitmq", "topics": ["orders"], "config": { "server_url": "rabbitmq.example.com:5672", "exchange": "events" }, "credentials": { "username": "guest", "password": "guest" } }'
sh

Message Format

Events are published as AMQP messages with:

  • Body: The event's data field (JSON)
  • Headers: Event metadata
  • Routing Key: The event topic

Example Message

If you publish an event:

{ "topic": "orders", "data": { "order_id": "123", "status": "created" }, "metadata": { "source": "checkout-service" } }
json

Body:

{ "order_id": "123", "status": "created" }
json

Headers:

Headers include system metadata and any event metadata from the published event:

HeaderSourceDescription
event-idSystemThe unique event ID
topicSystemThe event topic
timestampSystemEvent timestamp (Unix)
*EventAny additional metadata from the published event's metadata field

TLS Configuration

To enable TLS, set config.tls to true:

{ "type": "rabbitmq", "topics": ["orders"], "config": { "server_url": "rabbitmq.example.com:5671", "exchange": "events", "tls": "true" }, "credentials": { "username": "user", "password": "password" } }
json

Exchange Setup

Before sending events, ensure the exchange exists in RabbitMQ. Outpost publishes messages with the event topic as the routing key, allowing you to bind queues based on topic patterns.

Example RabbitMQ setup:

# Create a topic exchange rabbitmqadmin declare exchange name=events type=topic # Create a queue and bind it to receive all order events rabbitmqadmin declare queue name=order-events rabbitmqadmin declare binding source=events destination=order-events routing_key="orders.*"
bash