-
-
Notifications
You must be signed in to change notification settings - Fork 342
Add automatic SQS request batching support component: sqs #1438
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
Open
khc41
wants to merge
18
commits into
awspring:main
Choose a base branch
from
khc41:issue1355
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…late, SqsProperties, and BatchingSqsClientAdapter
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Added automatic SQS batching support using AWS SDK's SqsAsyncBatchManager.
This feature enables automatic request batching for SQS operations to improve performance and reduce AWS API calls. When enabled, Spring Cloud AWS automatically wraps the
SqsAsyncClient
with aBatchingSqsClientAdapter
that usesSqsAsyncBatchManager
internally.Key Features:
sendMessage
,receiveMessage
,deleteMessage
, andchangeMessageVisibility
operationsSqsTemplate
and@SqsListener
codeConfiguration Example:
Important: Operations are processed asynchronously. Applications should handle returned
CompletableFuture
objects to detect actual transmission errors.💡 Motivation and Context
AWS SDK 2.28.0+ introduced automatic request batching capabilities that can significantly improve SQS performance and reduce costs by combining multiple API calls into fewer requests.
Previously, users had to manually implement batching logic or use explicit batch operations. This change enables declarative batching at the configuration level, providing:
This addresses the community request for supporting AWS SDK's new automatic batching feature in Spring Cloud AWS.
💚 How did you test it?
Unit Tests:
BatchingSqsClientAdapterTests
: Comprehensive testing of all adapter methods with mock SqsAsyncBatchManagerIntegration Tests:
BatchingSqsClientAdapterIntegrationTests
: Real SQS environment testing with LocalStackAuto-Configuration Tests:
SqsAutoConfigurationTest
with comprehensive batch configuration testingspring.cloud.aws.sqs.batch.enabled
📝 Checklist
🔮 Next steps
This implementation provides full support for AWS SDK's automatic batching capabilities. Future enhancements could include:
Related AWS SDK Documentation: Use automatic request batching for Amazon SQS
Resolves #1355