It's difficult to help with the few info you provide but check the following:
Perhaps your queue is not properly setup
Dead letter queues redirection are not related to the consumer setup but to the way that the queues have been configured at creation in aws. So use the aws cli get-queue-attributes
command
https://docs.aws.amazon.com/cli/latest/reference/sqs/get-queue-attributes.html
to check if your source queue has the proper RedrivePolicy
. The output should display something like this example. Also controls that the maxReceiveCount
is setup properly in your source queue. From the doc:
maxReceiveCount – The number of times a message is delivered
to the source queue before being moved to the dead-letter queue.
When the ReceiveCount for a message exceeds the maxReceiveCount for a queue,
Amazon SQS moves the message to the dead-letter-queue.
If the dead letter queue has not been configured properly follow the aws create-queue
https://docs.aws.amazon.com/cli/latest/reference/sqs/create-queue.html
cli example to setup a dead letter queue to the source queue.
Try to send a message to the queue outside of spring using cli only with send-message
https://docs.aws.amazon.com/cli/latest/reference/sqs/send-message.html and ensure that the dead letter queue is properly popolated.
Perhaps SqsListener
is not pointing to the correct source queue
Messages may not be reaching the correct source queue that has a dead-letter queue attached. cloud.aws.endpoint.queue-name
should be the path to find the queue name in your application properties application.yml
like you just defined it:
cloud:
aws:
endpoint:
queue-name: "my-queue-name"