NATS - JetStream icon

NATS - JetStream

NATS - JetStream

Overview

This node integrates with NATS JetStream, a messaging system for streaming data. Specifically, the "Acknowledge a Message" operation allows the workflow to acknowledge a message that was received earlier from a NATS JetStream consumer (typically triggered by a preceding NATS - JetStream Trigger node). This acknowledgment informs the JetStream server that the message has been successfully processed, preventing it from being redelivered.

Common scenarios include:

  • Ensuring reliable message processing in event-driven workflows.
  • Preventing duplicate processing of messages by explicitly acknowledging them after successful handling.
  • Coordinating message flow control in distributed systems using NATS JetStream.

Example: After receiving and processing an order message via a JetStream trigger, this node can be used to acknowledge the message so that it is marked as handled.

Properties

Name Meaning
Will acknowledge an message from the stream consumer earlier in the workflow by a NATS - JetStream Trigger node Informational notice indicating that this operation acknowledges a previously received message from a JetStream consumer. No additional input parameters are required for this operation.

Output

The node outputs the acknowledged message(s) in JSON format, preserving the original message data structure received from the JetStream trigger. The output contains the same items as input but marked as acknowledged.

No binary data output is produced by this operation.

Dependencies

  • Requires connection to a NATS JetStream server.
  • Needs an API key credential or equivalent authentication configured in n8n to access the NATS service.
  • Depends on the presence of a prior NATS - JetStream Trigger node in the workflow to provide the message context for acknowledgment.

Troubleshooting

  • Common issues:

    • Attempting to acknowledge a message without a preceding JetStream trigger node will fail because there is no message context.
    • Network or authentication errors connecting to the NATS JetStream server.
    • Acknowledging a message multiple times may cause errors or unexpected behavior.
  • Error messages:

    • Errors related to missing or invalid credentials: Ensure the API key or authentication token is correctly set up.
    • Message not found or already acknowledged: Verify that the message was received and not previously acknowledged.
    • Connection timeouts or refusals: Check network connectivity and server availability.

Links and References

Discussion