CQRS Event icon

CQRS Event

Event

Custom

AI-generated

Summary

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-to queue and matches it by correlation ID. Defaults to false.
  • spread — When waiting for a reply, spread an array response or a response object's rows array 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 correlationId and success: true. With replies enabled, an error or err field becomes an item with an error; response or result becomes the item JSON. If spread is enabled, array responses and rows arrays are split into items. Other reply payloads are returned as-is. The node requires RabbitMQ credentials; connection or publish failures raise an operation error.

Links

Discussion