SQS QueuePoller sometimes returns dupe messages, raises BatchEntryIdsNotDistinct #2908
-
We use Aws::SQS::QueuePoller like so: poller = Aws::SQS::QueuePoller.new(queue_url, idle_timeout: 0, wait_time_seconds: 1)
poller.poll(max_number_of_messages: 10) do |batch|
do_work(batch)
end Very rarely - say, every 100k requests - When QueuePoller tries to clean up these messages (after I've not discovered this behaviour documented anywhere (that SQS might occasionally return duplicate messages when calling ReceiveMessage). It's presumably not considered a bug in SQS itself (..?) so should the SDK fix it by de-duping in |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey - I've created an issue with this: #2913 to track investigation. Assuming you're not using a FIFO queue, then this is expected behavior - SQS only guarantees "deliver at least once" behavior and application codes does need to be able to handle duplicate messages. However, I think that duplicate messages within one batch should potentially be handled by the SDK's QueuePoller code rather than the end user. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
#2918