Skip to content

Conversation

@LeonieAdis
Copy link
Contributor

@LeonieAdis LeonieAdis commented May 20, 2021

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

After the SimpleMessageListenerContainer has received SQS messages from a queue it does not check again, that the queue is still running and delivers all messages to their handlers even if the queue has stopped in the meantime.

💡 Motivation and Context

If a SimpleMessageListenerContainer is stopped, e.g. because the service instance is shut down, it might happen that while stopping, the container still receives some SQS messages from a queue, but doesn't distribute those messages to their handlers.
As a result, the SQS messages are invisible for other service instances that are listening to the same queue until the visibility timeout of the messages is reached. This causes a delay of the message delivery.
With this fix, all messages that are pulled from the queue - and thus set invisible - are delivered to their handlers and can therefore be processed, even if the SimpleMessageListenerContainer is stopped or the service is shut down.

💚 How did you test it?

Added a unit test:

  • Start a SimpleMessageListenerContainer
  • Send a SQS message
  • Stop the SimpleMessageListenerContainer
  • Verify that the message was received by its handler

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated reference documentation to reflect the change
  • All tests passing
  • No breaking changes

🔮 Next steps

@maciejwalkowiak maciejwalkowiak added component: sqs SQS integration related issue type: enhancement Smaller enhancement in existing integration labels May 31, 2021
Copy link
Contributor

@maciejwalkowiak maciejwalkowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for submitting PR!

@eddumelendez would you like to take a look?

@birnbuazn
Copy link

Any news on this?

@maciejwalkowiak maciejwalkowiak merged commit f372d45 into awspring:2.3.x Jul 17, 2021
@maciejwalkowiak maciejwalkowiak added this to the 2.3.2 milestone Jul 17, 2021
@maciejwalkowiak maciejwalkowiak changed the title Execute all received sqs messages Fix: Execute all messages received from SQS Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: sqs SQS integration related issue type: enhancement Smaller enhancement in existing integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants