IMQServiceOptions interface

Options accepted by an IMQ service.

Signature:

export interface IMQServiceOptions extends IMQOptions 

Extends: IMQOptions

Remarks

Extends the core queue options, so all transport settings — host, port, prefix, safeDelivery, useGzip, cluster, logger and the rest — are accepted and forwarded to the queue factory.

Properties

Property

Modifiers

Type

Description

afterCall?

IMQAfterCall<IMQService>

(Optional) Post-response hook. See IMQAfterCall.

beforeCall?

IMQBeforeCall<IMQService>

(Optional) Pre-dispatch hook. See IMQBeforeCall.

childrenPerCore

number

Workers to fork per CPU core. Ignored unless IMQServiceOptions.multiProcess is true.

drain?

boolean

(Optional) Drain in-flight requests before shutting down on SIGTERM/SIGINT instead of exiting on a fixed timer.

drainTimeout?

number

(Optional) Milliseconds a drain waits for in-flight requests before giving up on them and exiting anyway. Ignored unless IMQServiceOptions.drain is on.

echoRequest?

boolean

(Optional) Whether a reply carries back the whole request it answers.

handleSignals?

boolean

(Optional) Let this package handle SIGTERM, SIGINT, SIGHUP and SIGQUIT for the process. Set it to false when the host owns shutdown.

local?

boolean

(Optional) Serve this service in process as well: a client in the same process calls it directly, with no trip through the queue.

metricsServer?

IMQMetricsServerOptions

(Optional) Built-in metrics HTTP listener settings.

multiProcess

boolean

Fork one cluster worker per CPU core, multiplied by IMQServiceOptions.childrenPerCore.

wrapCall?

IMQWrapCall<IMQService>

(Optional) Around hook wrapping the method invocation. See IMQWrapCall.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.