Skip to main content

StreamConsumerOverrides

Defined in: src/interfaces/options.interface.ts:49

Overrides for JetStream stream and consumer configuration.

Properties

ackExtension?

optional ackExtension?: number | boolean

Defined in: src/interfaces/options.interface.ts:84

Auto-extend the NATS ack deadline via msg.working() during handler execution.

  • false (default): disabled — NATS redelivers after ack_wait if not acked.
  • true: auto-extend at ack_wait / 2 interval (calculated from consumer config).
  • number: explicit extension interval in milliseconds.

concurrency?

optional concurrency?: number

Defined in: src/interfaces/options.interface.ts:75

Maximum number of concurrent handler executions (RxJS mergeMap limit).

Default: undefined (unlimited — naturally bounded by max_ack_pending). Set this to protect downstream systems from overload.

Important: if concurrency < max_ack_pending, messages buffer in RxJS while their NATS ack timer ticks. Increase ack_wait proportionally to prevent unnecessary redeliveries.


consume?

optional consume?: Partial<ConsumeOptions>

Defined in: src/interfaces/options.interface.ts:63

Options passed to the nats.js consumer.consume() call. Controls prefetch buffer size, idle heartbeat interval, and auto-refill thresholds.

nats.js supports two consumption modes (message-based and byte-based). Do not mix max_bytes/threshold_bytes with threshold_messages — use one mode or the other.

See

https://github.com/nats-io/nats.js — ConsumeOptions


consumer?

optional consumer?: Partial<ConsumerConfig>

Defined in: src/interfaces/options.interface.ts:51


stream?

optional stream?: Partial<StreamConfig>

Defined in: src/interfaces/options.interface.ts:50