Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1041 Enable receiving messages from different message groups i… #1134

Conversation

alexisgra
Copy link
Contributor

…n the same Batch for FIFO queues

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Added a new SqsContainerOptions option : messageGrouping. True by default. When false, a new MessageSinkAdapter is used. This adapter does not have grouping function.

I was wondering whether I should add the new option messageGrouping in the @SqsListener annotation or leave the configuration only in the factory.
Although the option is only relevant for FIFO Queues with a listener in batch mode, I've decided to put the option in @SqsListener, which will make it easier for library users to configure.

I don't know if the name messageGrouping is meaningful enough, I can change it if necessary.

💡 Motivation and Context

Fix the issue #1041

💚 How did you test it?

I added a test in SqsFifoIntegrationTests. In this test, I configure a new listener with messageGrouping set to false. I send several messages from two different message groups.
In the listener, I verify that the batch of messages received contains messages from different message groups. Then, I check that all messages from each group have been received.

📝 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

…n the same Batch for FIFO queues

Added a new SqsContainerOptions option : messageGrouping. True by default.
@github-actions github-actions bot added component: sqs SQS integration related issue type: documentation Documentation or Samples related issue labels Apr 9, 2024
@tomazfernandes
Copy link
Contributor

Thanks for the PR @alexisgra! Left a few comments for your consideration.

…rategy

Rename messageGrouping by batchGroupingStrategy and add an enum as suggested for better extensibility. Remove the message grouping option from SQSListener annotation
@github-actions github-actions bot added the type: dependency-upgrade Dependency version bump label Jun 18, 2024
@alexisgra
Copy link
Contributor Author

Thank you very much for the review @tomazfernandes !
I've made the changes and updated the doc. I remain available if other changes need to be made 😃

@alexisgra
Copy link
Contributor Author

Thanks for the review @tomazfernandes !
I've updated the doc. I remain available if other changes need to be made !

@tomazfernandes
Copy link
Contributor

Thanks a lot for the PR @alexisgra!

I did some polishing to speed up merging and opened a new PR: #1192, so I'll close this one.

Looking forward to more!

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: dependency-upgrade Dependency version bump type: documentation Documentation or Samples related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants