NATS Consume

NATS Consume

Certified

Consume NATS JetStream messages

Pulls messages from a JetStream subject with explicit acks and writes them to Kestra internal storage. Requires a stream matching the rendered subject; defaults: deliverPolicy=All, pollDuration=PT2S, batchSize=10. Stops when no messages, maxRecords, or maxDuration is reached.

yaml
type: io.kestra.plugin.nats.core.Consume

Consume messages from any topic subject matching the kestra.> wildcard, using user password authentication.

yaml
id: nats_consume_messages
namespace: company.team

tasks:
  - id: consume
    type: io.kestra.plugin.nats.core.Consume
    url: nats://localhost:4222
    username: nats_user
    password: "{{ secret('NATS_PASSWORD') }}"
    subject: kestra.>
    durableId: someDurableId
    pollDuration: PT5S
Properties
Min length1

Subject to consume

Rendered subject or wildcard the JetStream stream is bound to.

Min length1

URL to connect to NATS server

The format is (nats://)server_url: port. You can also provide a connection token like so: nats://token@server_url: port

Default10
Minimum>= 1

Batch size

Maximum messages fetched per pull; defaults to 10.

Credentials files authentification

DefaultAll
Possible Values
AllLastNewByStartSequenceByStartTimeLastPerSubject

Deliver policy

JetStream deliver policy; defaults to All.

Durable consumer name

Optional durable name to resume position between runs.

Max duration

Optional wall-clock duration after which polling stops.

Max records

Optional cap on total messages; stops once reached.

Plaintext authentication password

Reference (ref) of the pluginDefaults to apply to this task.

DefaultPT2S

Poll duration

Wait time per fetch; defaults to PT2S.

Start time

ISO-8601 date-time rendered and parsed to set the deliver start; ignored if null.

Token authentification

Plaintext authentication username

Messages consumed

Total acknowledged messages during this run.

Formaturi

Output file URI

Kestra internal storage URI of the ION file containing consumed messages.