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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #768 #897

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fixes #768 #897

wants to merge 1 commit into from

Conversation

driverpt
Copy link

馃摙 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

馃摐 Description

Issue: #768 #769

DynamoDb Clients are now initialized Standalone

馃挕 Motivation and Context

We do not use Spring Data and just wanted simple DynamoDb Initialization

馃挌 How did you test it?

Integration Tests

馃摑 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

@driverpt
Copy link
Author

driverpt commented Sep 22, 2023

Reopening from #772 that for some reason was closed.

Code review requested changes were applied

@driverpt
Copy link
Author

driverpt commented Oct 3, 2023

@MatejNedic
Copy link
Member

Tnx on PR. Will try to look at it during the weekend.

@driverpt
Copy link
Author

driverpt commented Oct 9, 2023

Any updates?

@driverpt
Copy link
Author

Any updates here? We would appreciate this to facilitate upgrade to Spring Boot 3

@MatejNedic
Copy link
Member

Hey @driverpt , sorry for late response. I am finally done with all the things that I had waiting personally I will be having more time for open source. Expect review soon!

@MatejNedic MatejNedic self-assigned this Oct 19, 2023
static class DynamoDbTemplateConfiguration {
@ConditionalOnMissingBean(DynamoDbOperations.class)
@Bean
public DynamoDbTemplate dynamoDBTemplate(DynamoDbProperties properties,
Copy link
Member

Choose a reason for hiding this comment

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

We should think about creating DynamoDbAsyncTemplate
This is just a note, not required for this PR.

@MatejNedic
Copy link
Member

@maciejwalkowiak I think we can merge this one and release it in 3.0.3

@@ -101,31 +131,61 @@ static class StandardDynamoDbClient {

@ConditionalOnMissingBean
@Bean
public DynamoDbClient dynamoDbClient(AwsClientBuilderConfigurer awsClientBuilderConfigurer,
public DynamoDbClient standardDynamoDbClient(AwsClientBuilderConfigurer awsClientBuilderConfigurer,
Copy link
Contributor

Choose a reason for hiding this comment

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

changing bean names makes it a breaking change, in such case it would have to be included in 3.1.0. Perhaps we can leave bean names as they were?


configuration.region(AwsClientBuilderConfigurer.resolveRegion(properties, regionProvider))
.credentialsProvider(credentialsProvider).url(properties.getDax().getUrl());
return ClusterDaxClient.builder().overrideConfiguration(configuration.build()).build();
}

@ConditionalOnMissingBean
@Bean
public DynamoDbAsyncClient daxDynamoDbAsyncClient(DynamoDbProperties properties,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for PR @driverpt!

You sneaked in async client ;-) Is there a particular reason for that?

As much as we do want to autoconfigure async clients we need to think how to do it consistently in every module so that we don't create beans that consume resources without users knowing about it or needing it.

One of the principles of 3.0 was to not create more than needed in contract to 2.x, so we need to be careful.

Copy link
Author

Choose a reason for hiding this comment

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

Because in the project we just upgraded to Spring Boot 3, we use WebFlux + Async Clients :)

I think it's harmless because it has @ConditionalOnBean

@kwonglau
Copy link

+1 on this issue. I'm looking for the async version for a webflux project as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dynamodb DynamoDB integration related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants