---
title: "Discussion on \"Why Amazon SQS Duplicates Messages (and How to Fix It)\" | Hashnode"
description: "Discussion on \"Why Amazon SQS Duplicates Messages (and How to Fix It)\". Learn why Amazon SQS delivers duplicate messages when worker tasks exceed visibility timeouts, and how to prevent duplicate processing using idempotency."
url: "https://hashnode.com/posts/why-sqs-delivers-duplicate-messages/6b042058f1c3b59e79817a41"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why Amazon SQS Duplicates Messages (and How to Fix It)](https://doogal.dev/why-sqs-delivers-duplicate-messages?utm_source=hashnode&utm_medium=feed)

Learn why Amazon SQS delivers duplicate messages when worker tasks exceed visibility timeouts, and how to prevent duplicate processing using idempotency.

1d ago · 5 min read · doogal.dev  
Read the article

-   [#aws](https://hashnode.com/tag/aws)
-   [#backend](https://hashnode.com/tag/backend)
-   [#systemdesign](https://hashnode.com/tag/systemdesign)
-   [#softwareengineering](https://hashnode.com/tag/softwareengineering)

## Written by

[Doogal Simpson](https://hashnode.com/@doogal)

@doogal

  
[View profile](https://hashnode.com/@doogal)

"hey doogal, what is .... ?"

## Responses 1

Markdown supported · ⌘↵ to post

[SMTasker](https://hashnode.com/@smtasker)

[8h ago](https://hashnode.com/posts/why-sqs-delivers-duplicate-messages/6b042058f1c3b59e79817a41/comment/6b056b43fcc0deb1f25fe561)

An in-flight record needs a different response from a completed one. I would test this sequence: worker A claims the business ID, crashes before the side effect, and worker B receives the message while that claim still exists. B must not treat the claim alone as completed work and delete the only remaining message. That fixture makes claim expiry, recovery and the acknowledgement rule explicit.
