JaidenAshmore / java-dynamic-sqs-listener

Java SQS Listener library built to be customisable and dynamic during runtime
MIT License
50 stars 12 forks source link

Spring SQS Listeners should not default to 30s visibility timeout #365

Closed JaidenAshmore closed 3 years ago

JaidenAshmore commented 3 years ago

We should default to the setting that the SQS queue as it can be confusing if you didn't realise this default and your messages keep timing out.

JaidenAshmore commented 3 years ago

Release Notes

Changes the Spring Queue Listener annotations to use the Visibility Timeout set on the AWS SQS queue instead of defaulting to 30 seconds. This should prevent unexpected re-processing of messages when it wasn't realised that there was a default. This was also applied to the Kotlin DSL.

Upgrade Steps

If you wish to maintain the existing functionality you will need to change your queue annotations from:

 @QueueListener("${insert.queue.url.here}")

to be

 @QueueListener(value = "${insert.queue.url.here}", messageVisibilityTimeoutInSeconds = 30)