https://github.com/varunu28/sqs-dlq-demo
https://github.com/varunu28/sqs-dlq-demo
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/varunu28/sqs-dlq-demo
- Owner: varunu28
- Created: 2023-08-13T18:30:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-13T19:52:08.000Z (about 2 years ago)
- Last Synced: 2025-01-01T23:11:13.470Z (9 months ago)
- Language: Java
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sqs-dlq-demo
## Expected behavior?
Once we have consumed a message from an SQS queue upto its `maxReceiveCount` and not acknowledged its receipt by deleting it from the queue, the message should be pushed to its DLQ. [AWS Documentation](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) says:
```
The maxReceiveCount is the number of times a consumer tries receiving a message from a queue without deleting it before being moved to the dead-letter queue. Setting the maxReceiveCount to a low value such as 1 would result in any failure to receive a message to cause the message to be moved to the dead-letter queue.
```## What is happening?
The test is unable to consume message from DLQ although the message is present in the DLQ when read through `aws-cli`
## Investigation done till now
- Ensured that the `DelaySeconds` is set to 0 for DLQ so that there is no delay for messages being visible
- Verified that messages are being pushed to SQS DLQ by querying DLQ through CLI## Resolution
This is happening due to an undocumented optimization(maybe) on AWS end. So the message is not pushed to DLQ until you query the queue one more time post exhausting the `maxReceiveCount` threshold. The test is fixed by adding an un-neccessary call to query the SQS queue and then the message becomes visible in DLQ.This issue is already documented under https://github.com/localstack/localstack/issues/8234