Skip to content

SQS: Add autoconfiguration for maxDelayBetweenPolls#1365

Merged
tomazfernandes merged 2 commits into
awspring:mainfrom
krutip7:fix/add-missing-sqs-autoconfiguration-1354
Apr 17, 2025
Merged

SQS: Add autoconfiguration for maxDelayBetweenPolls#1365
tomazfernandes merged 2 commits into
awspring:mainfrom
krutip7:fix/add-missing-sqs-autoconfiguration-1354

Conversation

@krutip7
Copy link
Copy Markdown
Contributor

@krutip7 krutip7 commented Mar 27, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This PR includes following changes:

  • Added maxDelayBetweenPolls configuration property to SqsProperties
  • Added mapping for SqsContainerOptions.maxDelayBetweenPolls in SqsAutoConfiguration for configuring the property in SqsMessageListenerContainerFactory
  • Included test case for the new property in SqsAutoConfigurationTest
  • Added relevant docs for the new auto-configuration property spring.cloud.aws.sqs.listener.max-delay-between-polls

💡 Motivation and Context

Currently, there is no property available to configure the maxDelayBetweenPolls parameter for SQS Listener, making it difficult to configure it through the application properties. This change introduces the property max-delay-between-polls for SQS Listener.

Closes #1354

💚 How did you test it?

Built the project after making necessary changes and included the generated jar in a sample application. Ran this application in debug mode to verify whether the value mentioned in application.properties for max-delay-between-polls was being picked and correctly configured in SqsContainerOptions for the default SqsListenerContainerFactory bean.

📝 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

- Added configuration property to SqsProperties
- Added mapping for SqsContainerOptions.maxDelayBetweenPolls in SqsAutoConfiguration for configuring properties in SqsMessageListenerContainerFactory
- Included the test for new property in SqsAutoConfigurationTest
- Added docs for the new property max-delay-between-polls

Closes awspring#1354
@github-actions github-actions Bot added component: sqs SQS integration related issue type: documentation Documentation or Samples related issue labels Mar 27, 2025
Copy link
Copy Markdown
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 @krutip7 for the PR!

Looks great.

Could you just please add an assertion for the default maxDelayBetweenPolls in the configuresFactoryComponentsAndOptionsWithDefaults tests?

Just to keep everything synced up together and make sure we don't have any regressions in the future.

With that adjustment we'll merge it.

Thanks!

@krutip7
Copy link
Copy Markdown
Contributor Author

krutip7 commented Apr 12, 2025

Thanks for the feedback @tomazfernandes!

Update pushed with the assertion for default maxDelayBetweenPolls — should be all set now.

@tomazfernandes tomazfernandes merged commit 89bc6f2 into awspring:main Apr 17, 2025
1 check passed
@tomazfernandes
Copy link
Copy Markdown
Contributor

Thanks for the PR @krutip7!

Looking forward to more!

kcsurapaneni pushed a commit to kcsurapaneni/spring-cloud-aws that referenced this pull request Jun 13, 2025
* SQS: Add autoconfiguration for maxDelayBetweenPolls (awspring#1354)

- Added configuration property to SqsProperties
- Added mapping for SqsContainerOptions.maxDelayBetweenPolls in SqsAutoConfiguration for configuring properties in SqsMessageListenerContainerFactory
- Included the test for new property in SqsAutoConfigurationTest
- Added docs for the new property max-delay-between-polls

Closes awspring#1354

* SQS: Add test assertion for default maxDelayBetweenPolls
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.

Add maxDelayBetweenPolls to Autoconfiguration

2 participants