Skip to main content
Version: v0.0.3

Class: MllpBackpressureError

Thrown (or rejects the send() promise) when the in-flight queue exceeds the configured high-water mark and onBackpressure: 'reject' is set.

highWaterMark accepts a count cap, a byte cap, or both, when both are present, the stricter-of-two trigger wins.

Example

try {
await client.send(payload);
} catch (err) {
if (err instanceof MllpBackpressureError) {
logger.warn({
queueDepth: err.queueDepth,
queueBytes: err.queueBytes,
cap: err.highWaterMark,
});
}
}

Extends

  • Error

Constructors

Constructor

new MllpBackpressureError(message, opts): MllpBackpressureError

Construct an MLLP backpressure error.

Parameters

message

string

Human-readable error message.

opts

Backpressure context (queue depth, queued bytes, the high-water-mark hit).

highWaterMark

{ bytes?: number; count?: number; }

highWaterMark.bytes?

number

highWaterMark.count?

number

queueBytes

number

queueDepth

number

Returns

MllpBackpressureError

Overrides

Error.constructor

Properties

highWaterMark

readonly highWaterMark: object

The high-water-mark configuration that was triggered.

bytes?

readonly optional bytes?: number

count?

readonly optional count?: number


name

readonly name: "MllpBackpressureError"

Overrides

Error.name


queueBytes

readonly queueBytes: number

Total bytes of in-flight + queued frames at the moment of rejection.


queueDepth

readonly queueDepth: number

Number of in-flight + queued sends at the moment of rejection.