Skip to main content
A durable consumer is an event destination that Occtoo tracks the position of for you. Instead of storing a cursor yourself, your workers pull leased batches of CloudEvents and acknowledge them. Any number of stateless workers can share one durable consumer, and its progress survives worker restarts.
Both endpoints require the read:events scope. {id} is the ID of an event destination of type DURABLE_CONSUMER; other destination types return 400.

Pull a batch

A pull leases the next batch of events to the calling worker for visibility seconds.
200 response
A pull from a worker that still holds a lease returns that same lease. Pulling before acknowledging means the previous batch was abandoned.

Acknowledge a batch

Send the leaseId and generation from the batch with a status of ok or failed:
The response returns the outcome in status and the committed cursor in committed:
  • committed: the batch is done.
  • requeued: you sent failed, and the batch is redelivered with a higher attempt.
  • stale: the lease expired and was handed to another worker before your acknowledgement. Nothing was committed.
You can still acknowledge batches while the durable consumer is paused.

Delivery guarantees

  • Start. A durable consumer starts at the head of the event stream when you create it. Earlier events are never handed out.
  • Redelivery. Expired and failed leases are redelivered before new work, with a higher generation. An acknowledgement for an older generation is stale.
  • Order. Events are ordered within a batch. With several workers, batches interleave across them. Use a single worker when your processing depends on stream order.
  • Commit. The committed cursor only advances over a contiguous run of acknowledged batches, so one slow lease holds it back even when later batches are done.
Delivery is at-least-once. Make your processing idempotent.
Give each independent consumer its own durable consumer. Every worker pulling from the same durable consumer competes for the same stream.