StreamConsumerOverrides
@horizon-republic/nestjs-jetstream
@horizon-republic/nestjs-jetstream / StreamConsumerOverrides
StreamConsumerOverrides
Defined in: src/interfaces/options.interface.ts:128
Overrides for JetStream stream and consumer configuration.
Properties
ackExtension?
optionalackExtension?:AckExtensionConfig
Defined in: src/interfaces/options.interface.ts:167
Auto-extend the NATS ack deadline via msg.working() during handler execution.
false(default): disabled; NATS redelivers afterack_waitif not acked.true: auto-extend atack_wait / 2interval (calculated from consumer config).number: explicit extension interval in milliseconds.{ interval?, maxDuration? }: the same, plus how long one message may be extended.
A message stops being extended after 5 minutes unless maxDuration says otherwise.
concurrency?
optionalconcurrency?:number
Defined in: src/interfaces/options.interface.ts:155
Maximum number of handler executions in flight at once. Messages beyond the limit queue FIFO and drain as handlers settle.
Default: undefined (unlimited, naturally bounded by max_ack_pending).
Set this to protect downstream systems from overload.
If concurrency < max_ack_pending, messages buffer in RxJS
while their NATS ack timer ticks. Increase ack_wait proportionally to
prevent unnecessary redeliveries.
consume?
optionalconsume?:Partial<ConsumeOptions>
Defined in: src/interfaces/options.interface.ts:142
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?
optionalconsumer?:Partial<ConsumerConfig>
Defined in: src/interfaces/options.interface.ts:130
management?
optionalmanagement?:EntityManagement
Defined in: src/interfaces/options.interface.ts:176
Provisioning control for this kind's stream/consumer. Falls back to provisioning.management.
retry?
optionalretry?:RetryConfig
Defined in: src/interfaces/options.interface.ts:173
Delay before each redelivery after a handler throws or calls ctx.retry().
See RetryConfig.
stream?
optionalstream?:Partial<Omit<StreamConfig,"retention"|"subjects"|"description">>
Defined in: src/interfaces/options.interface.ts:129
subjectPrefix?
optionalsubjectPrefix?:string
Defined in: src/interfaces/options.interface.ts:179
Custom subject prefix (trailing dot normalized), e.g. 'company.orders.'.