1

In a use case that precludes the use of SQS FIFO queues, duplicate messages are a possibility.

If a consumer receives a duplicate message that it has already deleted, does it need to delete the duplicate?

I'm guessing that the answer is no, since duplicates are a function of the distributed implementation of SQS and assume that the delete action is just in the process of propagating through the AWS network, but is there any explicit documentation confirming this?

To clarify: FIFO queues are not involved here

Dancrumb
  • 26,597
  • 10
  • 74
  • 130
  • Even if you somehow discover that it is not necessary to delete the duplicate message, deleting the message would be harmless. You should delete it anyway. That is certainly what you're *intended* to do, and otherwise you're complicating the message processing protocol for no good reason. – Matt Timmermans Sep 05 '22 at 13:44

1 Answers1

-1

If a consumer receive such kind of message which is duplicate of a deleted message,it will not be deleted. Because it already get out from the queue.

For the fifo queue you have to provide MessageDeduplicationId in the send message parameter. And this id have to be unique.

So when a message with MessageDeduplicationId is already preserved (e.g. your consumer can return the message for any kind of error occured, one probability for visibility timeout) in your whole queue, the duplicate copy will be automatically deleted.

For sending message you can read this

For deduplication, learn more

Asif Jalil
  • 622
  • 5
  • 15