# IMQOptions interface · @imqueue/core

Source: https://imqueue.org/api/core/latest/core.imqoptions/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/core 3.3.2 — generated reference, not hand-written

Options accepted by every queue implementation.

Anything omitted falls back to [DEFAULT\_IMQ\_OPTIONS](https://imqueue.org/api/core/latest/core.default_imq_options/) — `localhost:6379`, prefix `imq`, cleanup off, safe delivery off, gzip off, a 5000 ms watcher check and safe-delivery TTL, and signal handling on.

**Signature:**

```typescript
export interface IMQOptions extends Partial<IMessageQueueConnection> 
```
**Extends:** Partial<[IMessageQueueConnection](https://imqueue.org/api/core/latest/core.imessagequeueconnection/)>

## Remarks

Only `cleanup` and `cleanupFilter` are required by the type, even though every constructor and [IMQ.create()](https://imqueue.org/api/core/latest/core.imq.create/) accepts a `Partial<IMQOptions>` — prefer `Partial<IMQOptions>` when declaring option literals.

The inherited `id` is meaningful only on [IMQOptions.cluster](https://imqueue.org/api/core/latest/core.imqoptions.cluster/) entries; the queue itself never reads it.

## Properties


| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [cleanup](https://imqueue.org/api/core/latest/core.imqoptions.cleanup/) |  | boolean | Turns on/off the watcher's periodic removal of orphaned keys. Defaults to `false`. |
| [cleanupFilter](https://imqueue.org/api/core/latest/core.imqoptions.cleanupfilter/) |  | string | Redis glob pattern, appended to the prefix as `<prefix>:<cleanupFilter>`, selecting which keys the cleanup sweep considers. Defaults to `'*'` — every key in the namespace. |
| [cluster?](https://imqueue.org/api/core/latest/core.imqoptions.cluster/) |  | [IMessageQueueConnection](https://imqueue.org/api/core/latest/core.imessagequeueconnection/)\[\] | _(Optional)_ Redis servers to spread this queue across. Supplying this — or [IMQOptions.clusterManagers](https://imqueue.org/api/core/latest/core.imqoptions.clustermanagers/) — makes [IMQ.create()](https://imqueue.org/api/core/latest/core.imq.create/) return a [ClusteredRedisQueue](https://imqueue.org/api/core/latest/core.clusteredredisqueue/). |
| [clusterManagers?](https://imqueue.org/api/core/latest/core.imqoptions.clustermanagers/) |  | [ClusterManager](https://imqueue.org/api/core/latest/core.clustermanager/)\[\] | _(Optional)_ Cluster managers that discover and maintain cluster servers dynamically. Supplying this — or [IMQOptions.cluster](https://imqueue.org/api/core/latest/core.imqoptions.cluster/) — makes [IMQ.create()](https://imqueue.org/api/core/latest/core.imq.create/) return a [ClusteredRedisQueue](https://imqueue.org/api/core/latest/core.clusteredredisqueue/). |
| [handleSignals?](https://imqueue.org/api/core/latest/core.imqoptions.handlesignals/) |  | boolean | _(Optional)_ Enable process signal handling (SIGTERM, SIGINT, SIGABRT) by the queue. When enabled, the queue releases its watcher lock on these signals and then exits the process. It does not wait for in-flight `message` handlers to finish, so drain those yourself if work in progress must not be lost. Disable if the host application manages shutdown. |
| [logger?](https://imqueue.org/api/core/latest/core.imqoptions.logger/) |  | [ILogger](https://imqueue.org/api/core/latest/core.ilogger/) | _(Optional)_ Logger used for queue diagnostics. Defaults to `console`. |
| [prefix?](https://imqueue.org/api/core/latest/core.imqoptions.prefix/) |  | string | _(Optional)_ Global key namespace for everything this queue writes. Defaults to `'imq'`. |
| [safeDelivery?](https://imqueue.org/api/core/latest/core.imqoptions.safedelivery/) |  | boolean | _(Optional)_ Enable guaranteed message delivery. When enabled, reading a message moves it atomically out of the queue into a worker-owned key instead of popping it outright, so a worker that dies before it even starts on a message leaves that message behind for the watcher to re-queue rather than taking it down with the process. The guarantee covers that hand-off, not the processing. The worker key is released as soon as the message is dispatched to the `message` listener, so a worker killed while its handler is still running loses that message exactly as it would with safe delivery off — draining in-flight work before exit is up to the application. Delivery is at-least-once in either mode, so handlers should be idempotent. |
| [safeDeliveryTtl?](https://imqueue.org/api/core/latest/core.imqoptions.safedeliveryttl/) |  | number | _(Optional)_ Lease deadline (in milliseconds) stamped onto the worker key when safeDelivery moves a message out of the queue, and the interval on which the watcher sweeps for expired keys. A worker key still present once its deadline has passed is treated as abandoned, and its message is moved back onto the main queue. This is a recovery deadline for an abandoned hand-off, not a processing deadline. The key is released when the message is dispatched, so a slow handler is neither interrupted nor re-queued for taking too long, and raising this value extends no protection over long-running work — tune it for how quickly an abandoned message should come back. |
| [useGzip?](https://imqueue.org/api/core/latest/core.imqoptions.usegzip/) |  | boolean | _(Optional)_ Enable message compression for serialization. Increases a worker CPU load but decreases network traffic between workers and the queue host. Defaults to `false`. |
| [vendor?](https://imqueue.org/api/core/latest/core.imqoptions.vendor/) |  | string | _(Optional)_ Queue adapter vendor name. Defaults to `'Redis'`, which is the only supported value. |
| [verbose?](https://imqueue.org/api/core/latest/core.imqoptions.verbose/) |  | boolean | _(Optional)_ Enables/disables verbose logging. |
| [verboseExtended?](https://imqueue.org/api/core/latest/core.imqoptions.verboseextended/) |  | boolean | _(Optional)_ Enables/disables extended verbose logging. |
| [watcherCheckDelay?](https://imqueue.org/api/core/latest/core.imqoptions.watchercheckdelay/) |  | number | _(Optional)_ Interval in milliseconds of the periodic watcher check. Defaults to 5000. |

