Nats icon

Nats

Sends messages to a Nats

Nats

AI-generated

Overview

This node sends messages to a NATS server, a messaging system used for communication between distributed systems. It is useful for scenarios where you want to publish messages to a specific subject (queue) on a NATS server, either sending the input data received by the node or a custom message. It supports adding headers to messages and can either wait for a response or just emit the message without waiting.

Use Case Examples

  1. Publishing sensor data to a NATS subject for real-time processing.
  2. Sending notifications or commands to microservices via NATS.
  3. Forwarding workflow data to other systems through NATS messaging.

Properties

Name Meaning
Subject Name of the queue or subject to publish the message to.
Send Input Data Whether to send the data the node receives as JSON to NATS.
Message The custom message to be sent if 'Send Input Data' is false.
JSON Parameters Whether to provide headers as JSON or as key-value pairs.
Headers Headers to include with the message, provided as key-value pairs if JSON Parameters is false.
Headers (JSON) Headers to include with the message, provided as a JSON object if JSON Parameters is true.
Options Additional options for sending the message.

Output

JSON

  • success - Indicates successful message sending.
  • error - Error message if sending failed.

Dependencies

  • NATS server connection with credentials including servers, queue, timeout, and optional username/password authentication.

Troubleshooting

  • Error if username and password are required but not provided for authentication.
  • Error if headers JSON is invalid when JSON Parameters is true.
  • Errors from NATS connection or message publishing are thrown unless 'Continue On Fail' is enabled, in which case errors are returned as output.

Discussion