Skip to main content
Version: Next
output/amqp09INPUTBUFFERPROCESSOROUTPUT

AMQP 0.9 (RabbitMQ)

The AMQP 0.9 output publishes messages to an AMQP 0.9/0.9.1 exchange such as RabbitMQ, with optional exchange declaration, per-row dynamic routing keys, AMQP message properties, and publisher confirms.

Configuration​

FieldTypeRequiredDefaultDescription
typestringyes—Fixed value "amqp09"
urlstringyes—AMQP broker URL (e.g. amqp://guest:guest@localhost:5672/%2f or amqps://...)
exchangestringyes—Exchange name to publish to (empty string "" targets the AMQP default exchange)
exchange_typestringnodirectExchange type when declaring the exchange (direct, fanout, topic, headers)
routing_keyobjectyes—Routing key for publishing (expression; see below)
declare_exchangebooleannofalseDeclare the exchange if it does not exist (cannot be true when exchange is "")
durablebooleannotrueMark the declared exchange as durable
auto_deletebooleannofalseAuto-delete the declared exchange when unused
persistentbooleanno—Sets AMQP delivery_mode to persistent (2) when true or transient (1) when false
confirmbooleannofalseEnable AMQP publisher confirms and return an error if the broker NACKs a message
priorityintegerno—AMQP message priority (0–255)
expirationintegerno—Per-message TTL in milliseconds
content_typestringno—MIME content type header (e.g. application/json)
content_encodingstringno—MIME content encoding header (e.g. utf-8)
value_fieldstringno—Binary or string column whose per-row value becomes that message's payload (a null value or missing column is an error). When unset, the codec encoding of the batch applies.

routing_key (Expr<String>)​

FieldTypeRequiredDescription
typestringyesvalue (static) or expr (SQL expression)
valuestringyes (value)Static routing key
exprstringyes (expr)SQL expression evaluated per row

An expression must yield a non-null string for every row: a NULL result for any row fails the batch with the expression and the row named (wrap it in COALESCE(expr, 'fallback') or filter such rows upstream).

A per-row destination result must carry one routing key per payload row: a shorter result fails the batch with both counts named instead of silently misrouting or dropping unmatched rows.

Examples​

Topic exchange with dynamic routing key and publisher confirms​

output:
type: "amqp09"
url: "amqp://guest:guest@localhost:5672/%2f"
exchange: "orders"
exchange_type: "topic"
routing_key:
type: "expr"
expr: "concat('orders.', region)"
declare_exchange: true
durable: true
persistent: true
confirm: true
content_type: "application/json"
value_field: "payload"

Default exchange publishing directly to a queue​

output:
type: "amqp09"
url: "amqp://guest:guest@localhost:5672/%2f"
exchange: ""
routing_key:
type: "value"
value: "tasks-queue"
persistent: true
confirm: true

TLS​

Use an amqps:// URL scheme to connect over TLS (for example amqps://user:pass@broker.example.com:5671/%2f). The client negotiates TLS natively via rustls using system root certificates.

Error behavior​

Transport, IO, heartbeat, and closed connection/channel errors surface as Disconnection. Broker protocol rejections, broker NACKs under confirm: true, expression-evaluation failures, and per-row routing-key alignment mismatches surface as deterministic Process errors.