nats

Subscribe to a NATS subject.

# Common config fields, showing default values
input:
nats:
urls:
- nats://127.0.0.1:4222
queue: benthos_queue
subject: benthos_messages

Metadata

This input adds the following metadata fields to each message:

- nats_subject

You can access these metadata fields using function interpolation.

Fields

urls

A list of URLs to connect to. If an item of the list contains commas it will be expanded into multiple URLs.

Type: array
Default: ["nats://127.0.0.1:4222"]

# Examples
urls:
- nats://127.0.0.1:4222

queue

The queue to consume from.

Type: string
Default: "benthos_queue"

subject

A subject to consume from.

Type: string
Default: "benthos_messages"

prefetch_count

The maximum number of messages to pull at a time.

Type: number
Default: 32