IMQ.create() method

Instantiates the queue adapter matching the given options and returns it ready to be started.

The adapter is chosen from options.vendor, of which only 'Redis' is supported. When either options.cluster or options.clusterManagers is present, the clustered adapter is returned instead of the single-server one.

Signature:

static create(name: string, options?: Partial<IMQOptions>, mode?: IMQMode): IMessageQueue;

Parameters

Parameter

Type

Description

name

string

queue name; the underlying Redis key becomes <prefix>:<name>

options

Partial<IMQOptions>

(Optional) queue options; anything omitted falls back to DEFAULT_IMQ_OPTIONS

mode

IMQMode

(Optional) whether the queue produces, consumes, or both; defaults to IMQMode.BOTH

Returns:

IMessageQueue

an unstarted queue instance — a ClusteredRedisQueue when cluster options were supplied, otherwise a RedisQueue

Exceptions

TypeError when options.vendor names an unknown adapter

Remarks

options.vendor is honoured only here. Constructing a queue class directly ignores it, because DEFAULT_IMQ_OPTIONS carries no vendor key.

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