# IMQOptions.safeDelivery property · @imqueue/core

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

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 the processing too, not only the hand-off: the worker key is held until the `message` listener has finished with the message, which for a listener returning a promise means until that promise settles. A worker killed at any point before then leaves the message behind to be re-queued.

A message comes back on either of two counts. The owning process leaving the broker's client list catches it dying — a fact the broker holds rather than an inference from a clock, so it is noticed as fast as the socket closes and nothing has to be renewed to keep a live lease alive. [IMQOptions.safeDeliveryTtl](https://imqueue.org/api/core/latest/core.imqoptions.safedeliveryttl/) catches what liveness cannot see: one handler wedged inside a worker that is otherwise up and serving.

Delivery is at-least-once in either mode, so handlers should be idempotent: this narrows the window in which in-flight work is lost, it does not close it.

**Signature:**

```typescript
safeDelivery?: boolean;
```

## Default Value

false

