Interface: ConnectionOptions
TypeScript 0.4.0 · Source commit cbff27b8a34e1384384018680e46c20d5c610cc9. Generated with reviewed comment corrections; see generation notes.
Defined in: types.ts:67
Connection options for PostgreMQ client
Properties
config?
optionalconfig?:PoolConfig
Defined in: types.ts:75
Configuration for a client-owned pool; ignored when pool is supplied.
A supplied connectionString replaces this object's connectionString field.
connectionString?
optionalconnectionString?:string
Defined in: types.ts:73
PostgreSQL connection string. Ignored when pool is supplied. Otherwise
assigned into config.connectionString, mutating a supplied config object.
extenderBatchSize?
optionalextenderBatchSize?:number
Defined in: types.ts:100
Maximum number of in-flight messages the connection-level auto-extension actor extends in a single set_vt_batch_multi call per tick. Auto-extension is connection-level (one actor coalesces every consumer's due extensions), so this is a connection option, not a per-consumer one. Bounds statement size only — correctness does not depend on it. Default 100. Must be > 0.
meterProvider?
optionalmeterProvider?:MeterProvider
Defined in: types.ts:71
Opt-in metrics. The application owns SDK/exporters and provider shutdown. Omitted means no-op, even when a global provider exists. To use the global provider, explicitly pass metrics.getMeterProvider() from the OTel API.
onQueueFatal?
optionalonQueueFatal?: (queue,error) =>void
Defined in: types.ts:92
Called when a queue becomes fatal for this connection — it is gone and any
consumers on it have been torn down. Fires when the queue is deleted
out-of-band (a consume returns PMQ02) or when an exclusive queue's
keep-alive permanently fails. The error is a QueueFatalError. This is the
queue-level signal; consumers also learn via Consumer.onClose, and it is the
only signal for a producer-only exclusive queue with no consumer. The same
event is emitted on the connection's emitter as 'queueFatal'. Optional —
omit it to fall back to logging only.
Parameters
queue
string
error
unknown
Returns
void
pool?
optionalpool?:Pool
Defined in: types.ts:77
Caller-owned pool. Takes precedence over config and connectionString.
PostgreMQ never ends this pool; close PostgreMQ before ending it yourself.
retry?
optionalretry?:RetryPolicy
Defined in: types.ts:81
Retry timing. Defaults: 5 total attempts, 100 ms initial backoff, multiplier 2, and 5000 ms maximum backoff. Ordinary operations retry selected connection and transient database errors. Standalone publish retries only serialization failures (40001) and deadlocks (40P01); transaction-bound publish and acknowledgement do not apply internal retries.
shutdownTimeoutMs?
optionalshutdownTimeoutMs?:number
Defined in: types.ts:79
Shutdown budget in milliseconds. Default 30000. Each consumer stop uses this budget; connection close shares one total budget across shutdown work. A consumer stopped during close uses the remaining close budget.