NATS - JetStream Trigger icon

NATS - JetStream Trigger

Consumer JetStream stream message

NATS - JetStream Trigger

AI-generated

Overview

This node acts as a trigger for NATS JetStream messages from a specified stream and consumer. It listens for messages on the JetStream and triggers workflow executions when messages are received. It supports options for message acknowledgment timing, content handling (binary or JSON parsing), and parallel message processing limits. This node is useful for workflows that need to react to real-time streaming data or events from a NATS JetStream.

Use Case Examples

  1. Trigger a workflow whenever a new message arrives on a specific JetStream stream and consumer.
  2. Process messages in parallel with a limit on concurrent executions to manage load.
  3. Acknowledge messages immediately upon receipt or after workflow execution finishes, depending on the use case.

Properties

Name Meaning
Stream The name of the JetStream stream to listen to for messages.
Consumer The name of the consumer within the JetStream stream to receive messages from.
Options Additional options to control message processing behavior.

Output

JSON

  • content - The content of the JetStream message, optionally parsed or as binary.
  • messageMetadata - Metadata about the received message, such as headers and acknowledgment status.

Dependencies

  • NATS JetStream service for consuming messages
  • An API key credential for NATS connection

Troubleshooting

  • Ensure the stream and consumer names are correct and exist in the NATS JetStream server.
  • Parallel message processing limit must be greater than zero or -1 for no limit; otherwise, an error is thrown.
  • If the node unexpectedly closes, check network connectivity and JetStream server status.
  • Errors during message consumption are emitted and can be handled in the workflow.

Discussion