Piloterr
Destinations

RabbitMQ

Publish Dataflow's events to a RabbitMQ exchange over TLS, with a user that may only write to it.

Each event is published to your exchange, with the topic (run.completed…) as routing key. Your bindings decide which queues get it.

Set up RabbitMQ

Open a TLS listener to the internet

Dataflow connects over AMQP with TLS (amqps), on port 5671 (or 9092, 9093, 9094, 9096). The broker's certificate must be valid for its host name and issued by a public certificate authority: self-signed certificates are refused. The host name must resolve to a public address.

Create the exchange and bind a queue

A topic exchange lets you bind on patterns of event types:

rabbitmqadmin declare exchange name=dataflow-events type=topic durable=true
rabbitmqadmin declare queue name=dataflow-runs durable=true arguments='{"x-queue-type": "quorum"}'
rabbitmqadmin declare binding source=dataflow-events destination=dataflow-runs routing_key='run.*'

# as routing key binds every topic. A message that matches no binding is dropped by RabbitMQ, and the delivery still shows OK.

Create a user that may only write to the exchange

rabbitmqctl add_user dataflow 'A_LONG_RANDOM_PASSWORD'
rabbitmqctl set_permissions -p / dataflow '^$' '^dataflow-events$' '^$'

The three patterns are configure, write and read: nothing to declare, write to dataflow-events only, nothing to read. To publish to the default exchange instead, the write pattern is '^amq\.default$'. Use a user name and password without / ? # % @ : or spaces.

Add the destination

curl https://dataflow.piloterr.com/v1/destinations \
  -H "x-api-key: YOUR_API_KEY" -H "content-type: application/json" \
  -d '{
    "type": "rabbitmq",
    "config": { "host": "rabbit.example.com", "port": 5671, "vhost": "prod", "exchange": "dataflow-events", "tls": true },
    "credentials": { "username": "dataflow", "password": "A_LONG_RANDOM_PASSWORD" },
    "topics": ["run.completed", "run.failed"]
  }'
FieldRequiredSecretHolds
config.hostyesnoThe broker's host name, without scheme or port.
config.portnono5671 by default; 5671, 9092, 9093, 9094 or 9096.
config.vhostnonoThe virtual host. Left out: the server's default (/).
config.exchangenonoWhere events are published. Left out: the default exchange, which routes each event to a queue named like its topic (run.completed).
config.tlsnonotrue by default, and required.
credentials.usernameyesyesThe RabbitMQ user.
credentials.passwordyesyesIts password.

Credentials are stored encrypted and shown masked. To change them, send both again with PATCH. See Credentials.

Network

Dataflow connects from our egress address, 116.203.84.164 (exit_ips of GET /v1/destinations/types): allow it on the broker's port in your firewall. Private addresses, names that resolve to one, plain AMQP and other ports are refused when you save (422 validation_failed).

What the exchange receives

  • Routing key: the topic, such as run.completed.
  • Body: the event payload, with content type application/json.
  • Headers: event-id (the payload's id: deduplicate on it), topic and timestamp (when it was sent, RFC 3339).

Messages are published without the persistent flag. Bind a quorum queue, as above, or a durable classic queue with your own policy, if they must survive a broker restart.

Test it

Send a test event from the dashboard, or POST /v1/destinations/{id}/test (details), then look at the queue in the management interface (Queues → Get messages).

code or errorFix
422 validation_failed on config.hostUse a public host name; private and .internal addresses are refused.
422 validation_failed on config.tlsTurn TLS on: plain AMQP is refused.
dns_error, connection_refused, timeoutCheck the host and port, and that your firewall allows our address.
tls_errorUse a certificate from a public authority, valid for the host name.
auth_failedCheck the user name and password, and that the user may use the virtual host.
access_deniedThe user's write permission does not match the exchange.
exchange_not_foundCreate the exchange, in this virtual host, with this exact name.
OK but the queue is emptyNo binding matches the topic: bind with # or run.*.

Other errors: Errors.

On this page