# Make a consumer idempotent so a redelivery stops causing a second effect

A consumer that charges twice when a message is redelivered, made safe to receive the same message again.

Category: Queues, jobs, and async work
Source: https://letsship.ai/use-cases/make-a-consumer-idempotent
Published: 2026-08-25

## Goal

Make one queue consumer idempotent under redelivery.

## Acceptance criteria

- Delivering the same message twice produces one effect
- The deduplication key is derived from the message, not from arrival time
- A test replays a message and asserts a single effect
- Deduplication records expire on a stated schedule

## What lands as proof

A replay test asserting one effect from two deliveries, which is the entire guarantee.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Make the {consumer} consumer idempotent

Description: Make one queue consumer idempotent under redelivery.

Acceptance criteria:
- Delivering the same message twice produces one effect
- The deduplication key is derived from the message, not from arrival time
- A test replays a message and asserts a single effect
- Deduplication records expire on a stated schedule

Before you create the issue, find a consumer in this repository with side effects and no deduplication, and replace {consumer}.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: make one queue consumer idempotent under redelivery. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.

### How do I know the work is done?

The pull request carries the evidence, not only the diff. Here that means replay test proving one effect from two deliveries, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

The run stops once the plan is written. Somebody reads the approach and approves it before any code exists, which is the cheapest moment to redirect the work.
