AMQP Connector
Overview
Section titled “Overview”The AMQP connector enables publish/subscribe messaging through RabbitMQ and any AMQP 0.9.1 broker, with exchanges, queues, and routing keys.
Connector Types:
AmqpReader- Consume messages from a queue or exchange bindingAmqpWriter- Publish messages to an exchange with a routing key
AMQP Reader
Section titled “AMQP Reader”Consume messages from an existing queue:
{ "type": "AmqpReader", "config": { "url": "amqp://guest:guest@localhost:5672/", "queue": "sensor_events", "autoAck": false, "prefetchCount": 10, "consumerTag": "meddle-reader" }}Bind to an Exchange
Section titled “Bind to an Exchange”When queue is empty and exchange is set, the reader declares a temporary exclusive queue and binds it to the exchange using routingKey:
{ "type": "AmqpReader", "config": { "url": "amqp://user:password@rabbit.example.com:5672/", "exchange": "factory.events", "routingKey": "line1.*.temperature", "autoAck": true }}TLS Connection
Section titled “TLS Connection”{ "type": "AmqpReader", "config": { "url": "amqps://user:password@rabbit.example.com:5671/", "queue": "secure_events", "tls": true, "autoAck": false }}AMQP Writer
Section titled “AMQP Writer”Publish messages to an exchange:
{ "type": "AmqpWriter", "config": { "url": "amqp://guest:guest@localhost:5672/", "exchange": "factory.events", "routingKey": "line1.temperature", "mandatory": false, "contentType": "application/json" }}Publish to Default Exchange (Queue Directly)
Section titled “Publish to Default Exchange (Queue Directly)”Leave exchange empty and use the queue name as the routing key:
{ "type": "AmqpWriter", "config": { "url": "amqp://guest:guest@localhost:5672/", "exchange": "", "routingKey": "sensor_events" }}Configuration Parameters
Section titled “Configuration Parameters”- url: AMQP connection URI (
amqp://user:pass@host:port/vhostoramqps://...) - exchange: Exchange name (empty string targets the default exchange)
- queue: Queue name to consume from (Reader only)
- routingKey: Routing key or binding pattern
- tls: Use TLS for the connection
- prefetchCount: (Reader) Max unacknowledged messages on the channel
- autoAck: (Reader) Auto-acknowledge messages on delivery
- consumerTag: (Reader) Client-supplied consumer identifier
- mandatory: (Writer) Return message to publisher if it cannot be routed
- contentType: (Writer) MIME type for published messages (default:
application/json)
Acknowledgement Modes
Section titled “Acknowledgement Modes”- autoAck: true - The broker considers messages delivered as soon as they are sent. Faster but messages can be lost on consumer crash.
- autoAck: false - Meddle explicitly acks each successful message and nacks on payload errors. Use with
prefetchCountto bound in-flight messages.
Routing Key Patterns
Section titled “Routing Key Patterns”Topic exchanges support wildcards in binding keys:
*matches exactly one word:line1.*.temperature#matches zero or more words:factory.#