Skip to main content
Version: Next

NATS

The NATS input connects to a NATS server and supports two modes: regular subscriptions (regular) and JetStream pull consumers (jet_stream).

Configuration

FieldTypeRequiredDefaultDescription
typestringyesConstant value "nats"
urlstringyesNATS server URL, e.g. nats://host:4222; multiple servers separated by commas
modeobjectyesOperating mode, see table below (tagged enum, distinguished by the type field)
authobjectnoAuthentication configuration, see table below

mode (regular)

FieldTypeRequiredDescription
typestringyes"regular"
subjectstringyesNATS subject to subscribe to
queue_groupstringnoQueue group name

mode (jet_stream)

FieldTypeRequiredDescription
typestringyes"jet_stream"
streamstringyesStream name
consumer_namestringyesConsumer name
durable_namestringnoDurable consumer name

auth

FieldTypeRequiredDescription
usernamestringnoUsername
passwordstringnoPassword (used together with username)
tokenstringnoToken; takes precedence over username/password when both are present

Examples

input:
type: "nats"
url: "nats://localhost:4222"
mode:
type: "regular"
subject: "my.subject"
queue_group: "my_group"
input:
type: "nats"
url: "nats://localhost:4222"
mode:
type: "jet_stream"
stream: "my_stream"
consumer_name: "my_consumer"
durable_name: "my_durable"
auth:
token: "my_token"