3.0.0-M1 #431
maciejwalkowiak
started this conversation in
General
3.0.0-M1
#431
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Spring Cloud AWS 3.0 is a rewrite of the project using AWS SDK v2 for Java. Since this has required a major refactoring, we took it as an opportunity to revisit all the assumptions and integrations modules. As a result, we've produced a library that is lightweight, flexible, causes less headache, provides simple to use abstractions and also works much better with Kotlin.
Only a subset of integrations have been migrated in M1:
We strongly recommend checking out completely rewritten reference documentation for a deep dive into each integration including code samples:
📗 https://docs.awspring.io/spring-cloud-aws/docs/3.0.0-M1/reference/html/index.html
Core
Dropped support for XML configuration and
@EnableXXXannotations. Spring Cloud AWS can be used either with Spring Boot auto-configurations, or beans have to be created manually.New properties prefix
All Spring Cloud AWS related properties have moved from
cloud.awstospring.cloud.awsprefix.Endpoint configuration
Endpoint used by all integrations can be configured through a property:
spring.cloud.aws.endpoint=http://localhost:4566Endpoint used by an individual integration can be also defined per integration:
spring.cloud.aws.s3.endpoint=http://localhost:4566This is especially useful when Localstack is used instead of real AWS.
Credentials and region configuration
Credentials and region are resolved through the new interfaces from AWS SDK v2 for Java:
software.amazon.awssdk.auth.credentials.AwsCredentialsProviderandsoftware.amazon.awssdk.regions.providers.AwsRegionProvider.It is possible to configure both through properties. In special cases, users can provide custom implementations of these interfaces to opt-out from ones that are auto-configured. Check the reference documentation for more details.
Nullability annotations
Every class field, method parameter and return value is annotated with
@NonNullor@Nullableannotation, making it easier to use with null safe languages like Kotlin.AWS Client Builder Configurers
AwsClientBuilderConfigurersimplifies applying same configuration for endpoint, region and credentials to user defined AWS clients beans:AWS Client Customizers
AwsClientCustomizersimplifies customizing AWS clients created by integrations without overwriting complete beans:Note that
AwsClientCustomizeris a parameterized type, and the type determines to which client customization gets applied.S3
io.awspring.cloud.s3package.SimpleStorageResourcehas been renamed toS3Resourcespring.cloud.aws.s3propertiesResourcePatternResolver.Cross-Region S3 client
S3Clientimplementation provided by Spring Cloud AWS can access buckets in any region. When accessed bucket is in other region than the one provided for S3 auto-configuration, theCrossRegionS3Clientshandles redirects sent by S3 transparently.Output Streams
S3 integration comes with three implementations of the
OutputStreamused under the hood byS3Resourcefor writing data to S3.InMemoryBufferingS3OutputStream(default) - buffers content of the uploaded file in memory and uploads to S3 using multipart uploadDiskBufferingS3OutputStream- saves uploaded file to temporary folder on disk and uploads to S3 in single chunkTransferManagerS3OutputStream- uses experimental Transfer Manager to upload files to S3. Requires adding a dependency tosoftware.amazon.awssdk:s3-transfer-managerTo use different output stream than one provided by auto-configuration, define a bean of type
S3OutputStreamProvider- either with custom implementation or one of:DiskBufferingS3OutputStreamProvider,TransferManagerS3OutputStreamProvider,InMemoryBufferingS3OutputStreamProvider.S3Template
S3Templateis a new class that simplifies performing common operations on S3 buckets and S3 objects. It also supports reading and persisting Java objects to S3. Spring Cloud AWS provides Jackson basedJackson2JsonS3ObjectConverterwhich serialized persisted objects into JSON files. Custom object converted can be provided by defining a bean of typeS3ObjectConverter.Object Metadata Support
Both
S3ResourceandS3Templatesupport setting object metadata through a builder-like objectObjectMetadata.Content-Type Resolution
If uploaded file to S3 does not have
contentTypemetadata property set, bothS3ResourceandS3Templatewill resolve content type throughS3ObjectContentTypeResolver. The default implementation resolves content type by file extension. The framework provides a comprehensive support for 817 file extensions.SES
SES integration does not bring any new features in comparison to what's offered in version 2.4.1.
SES integration can be configured using properties with
spring.cloud.aws.sesprefix.SNS
On top of what's been offered in 2.4.1, SNS integration provides a simple interfaces for sending notifications with custom payload and headers using
SnsOperations#sendNotificationmethod andSnsNotificationobject.Because SNS Message Manager has not been migrated to AWS SDK v2, we had to drop support for message signature validation. We hope AWS finishes migration before Spring Cloud AWS reaches 3.0 GA.
SNS integration can be configured using properties with
spring.cloud.aws.snsprefix.Secrets Manager
spring.config.import=aws-secretsmanageris now possibleSecretsManagerClientSecrets Manager integration can be configured using properties with
spring.cloud.aws.secretsmanagerprefix.Parameter Store
spring.config.import=aws-parameterstoreis now possibleSsmClientParameter Store integration can be configured using properties with
spring.cloud.aws.parameterstoreprefix.Reference Documentation
Reference documentation has been rewritten with simplicity and "straight to the point" attitude.
📗 https://docs.awspring.io/spring-cloud-aws/docs/3.0.0-M1/reference/html/index.html
Feedback
We are aware that this release breaks existing code but this was the only sensible way we could evolve the framework and meet the demand in constrained time we have. We are very open for your feedback and appreciate any shoutout on social media and Github ⭐️.
This release would not happen without our wonderful community. Big thanks for your bug reports, ideas and pull requests!
New Contributors
TransferManager. #361Full Changelog: v2.4.1...v3.0.0-M1
This discussion was created from the release 3.0.0-M1.
Beta Was this translation helpful? Give feedback.
All reactions