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

Add acknowledgement mode on @SqsListener annotation #870

Merged
merged 11 commits into from
Nov 4, 2023

Conversation

jvcalassio
Copy link
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This PR adds a parameter on the @SqsListener annotation that configures the acknowledgement mode for the created container. The default behavior is the same as it's now: uses the acknowledgement mode defined on the container factory. However, once the parameter is set, the factory value is overwritten in favor of the value defined on the annotation.

💡 Motivation and Context

This feature was requested on issue #761. By having this feature, users coming from the 2.x.x versions will have a easier time migrating to 3.x.x, given that this parameter was used to configure the acknowledgement mode on the previous major version of the library.

💚 How did you test it?

  1. Integration tests
  2. Sample application with new version of the library

📝 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

@github-actions github-actions bot added component: sqs SQS integration related issue type: documentation Documentation or Samples related issue labels Aug 23, 2023
@jvcalassio jvcalassio marked this pull request as ready for review August 23, 2023 00:03
@jvcalassio jvcalassio changed the title Sqs ack on annotation Add acknowledgement mode on @SqsListener annotation Aug 23, 2023
Copy link
Contributor

@tomazfernandes tomazfernandes left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @jvcalassio, looks good.

Left a couple of comments, please let me know if they make sense to you.

- Change SqsListenerAcknowledgementMode from enum to class with const
  strings
- Change typo on "acknowledgement" annotation field
- Remove unnecessary field on SqsContainerOptionsBuilder
- Move integration tests to its own test suite
- Update docs to reflect new "DEFAULT" annotation ack mode
- Update comments with latest changes
@jvcalassio
Copy link
Contributor Author

Thanks for the comments @tomazfernandes. They all made a lot of sense, so I pushed a new version with the suggested changes. Let me know if you have any other suggestions

Copy link
Contributor

@tomazfernandes tomazfernandes left a comment

Choose a reason for hiding this comment

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

Hey @jvcalassio, thanks for the changes!

Left a couple other comments, let me know if they make sense to you.

docs/src/main/asciidoc/sqs.adoc Outdated Show resolved Hide resolved
Copy link
Contributor

@tomazfernandes tomazfernandes left a comment

Choose a reason for hiding this comment

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

@jvcalassio not sure if you were done with the changes, just looking at them again.

Also please add your name as an author to the classes you changed.

Thanks!

- Remove "DEFAULT" annotation acknowledgement mode, use empty string as
  default
- Update docs
- Add author on modified classes
@jvcalassio
Copy link
Contributor Author

@jvcalassio not sure if you were done with the changes, just looking at them again.

Also please add your name as an author to the classes you changed.

Thanks!

Did it! I also put @since 3.1 on the new classes, considering that the original issue had 3.1 as milestone. Is that correct?

@tomazfernandes
Copy link
Contributor

@jvcalassio seems there are some failing tests - would you mind taking a look?

Thanks.

@jvcalassio
Copy link
Contributor Author

@jvcalassio seems there are some failing tests - would you mind taking a look?

Thanks.

Sorry! The condition for resolving the value was inverted (even my own tests were failing 🤦). I ran all the SQS tests locally and it seems to be fine now.

Copy link
Contributor

@tomazfernandes tomazfernandes left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @jvcalassio, looking forward for more!

@tomazfernandes tomazfernandes merged commit 273f8f9 into awspring:main Nov 4, 2023
4 checks passed
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: documentation Documentation or Samples related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants