RpcConfig
RpcConfig = {
mode:"core";timeout?:number; } | {ackExtension?:boolean|number;concurrency?:number;consume?:Partial<ConsumeOptions>;consumer?:Partial<ConsumerConfig>;mode:"jetstream";stream?:Partial<StreamConfig>;timeout?:number; }
Defined in: src/interfaces/options.interface.ts:20
RPC transport configuration.
Discriminated union on mode:
'core'— NATS native request/reply. Lowest latency.'jetstream'— Commands persisted in JetStream. Responses via Core NATS inbox.
When mode is 'core', only timeout is available.
When mode is 'jetstream', additional stream/consumer overrides are exposed.
Union Members
Type Literal
{ mode: "core"; timeout?: number; }
mode
mode:
"core"
timeout?
optionaltimeout?:number
Request timeout in ms. Default: 30_000.
Type Literal
{ ackExtension?: boolean | number; concurrency?: number; consume?: Partial<ConsumeOptions>; consumer?: Partial<ConsumerConfig>; mode: "jetstream"; stream?: Partial<StreamConfig>; timeout?: number; }
ackExtension?
optionalackExtension?:boolean|number
Auto-extend ack deadline via msg.working() during RPC handler execution.
The RPC handler timeout (setTimeout + msg.term()) still acts as the hard cap.
concurrency?
optionalconcurrency?:number
Maximum number of concurrent RPC handler executions.
consume?
optionalconsume?:Partial<ConsumeOptions>
Options passed to the nats.js consumer.consume() call for the command consumer.
consumer?
optionalconsumer?:Partial<ConsumerConfig>
Raw NATS ConsumerConfig overrides for the command consumer.
mode
mode:
"jetstream"
stream?
optionalstream?:Partial<StreamConfig>
Raw NATS StreamConfig overrides for the command stream.
timeout?
optionaltimeout?:number
Handler timeout in ms. Default: 180_000 (3 min).