Summary
Add an optional idempotencyKey to queue send options for message deduplication.
Motivation
Clients retrying after network failures can accidentally double-publish messages. An idempotency key lets the queue silently drop duplicates.
Proposed design
- Add optional
idempotencyKey: string to send options (both client-side handle.send() and actor-side c.queue.send())
- On receive, check actor KV for
idem:{key}. If exists, silently drop the message (or return existing messageId)
- Store
idem:{key} → messageId in actor KV on successful enqueue
- Keys expire after a configurable window (or when the message is consumed)
- Actor-scoped queues keep the keyspace small, so a plain KV map is sufficient (no bloom filter needed)
Summary
Add an optional
idempotencyKeyto queue send options for message deduplication.Motivation
Clients retrying after network failures can accidentally double-publish messages. An idempotency key lets the queue silently drop duplicates.
Proposed design
idempotencyKey: stringto send options (both client-sidehandle.send()and actor-sidec.queue.send())idem:{key}. If exists, silently drop the message (or return existing messageId)idem:{key} → messageIdin actor KV on successful enqueue