Custom
AI-generatedSummary
Publish a custom event to a RabbitMQ exchange using a routing key formed from the routing key prefix and pattern. Optionally wait for and return a matching reply.
Inputs
- routingKeyPrefix — Prefix for the routing key; defaults to
event. - exchange — RabbitMQ exchange to publish to; defaults to
cqrs. - options — Optional publish settings, including headers and key/value arguments. The other displayed queue options are passed as exchange assertion options when connecting.
- pattern (required) — Custom pattern appended to the routing key prefix, separated by a dot.
- payload (required) — JSON payload to publish. Objects are serialized to JSON; string values are sent as-is.
- replyQueue — When enabled, waits for a reply on RabbitMQ's
amq.rabbitmq.reply-toqueue and matches it by correlation ID. Defaults to false. - spread — When waiting for a reply, spread an array response or a response object's
rowsarray into separate output items. Defaults to false.
Output shape
One output item per input item after publishing, or reply-derived items when waiting for replies.
Without waiting for a reply, each successful publish returns JSON containing
correlationIdandsuccess: true. With replies enabled, anerrororerrfield becomes an item with an error;responseorresultbecomes the item JSON. If spread is enabled, array responses androwsarrays are split into items. Other reply payloads are returned as-is. The node requires RabbitMQ credentials; connection or publish failures raise an operation error.