Skip to content

Commit

Permalink
Issue micronaut-projects#605 - stop attempting to inject SdkAsyncHttp…
Browse files Browse the repository at this point in the history
…Client when the async http clients have been explicitly excluded from the build
  • Loading branch information
ducampbe committed Oct 14, 2020
1 parent 35f560d commit 4051b56
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -18,6 +18,7 @@
import io.micronaut.aws.sdk.v2.service.AwsClientFactory;
import io.micronaut.context.annotation.Bean;
import io.micronaut.context.annotation.Factory;
import io.micronaut.context.annotation.Requires;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain;
import software.amazon.awssdk.http.SdkHttpClient;
import software.amazon.awssdk.http.async.SdkAsyncHttpClient;
Expand Down Expand Up @@ -73,13 +74,15 @@ public DynamoDbClient syncClient(DynamoDbClientBuilder builder) {

@Override
@Singleton
@Requires(beans = SdkAsyncHttpClient.class)
public DynamoDbAsyncClientBuilder asyncBuilder(SdkAsyncHttpClient httpClient) {
return super.asyncBuilder(httpClient);
}

@Override
@Bean(preDestroy = "close")
@Singleton
@Requires(beans = SdkAsyncHttpClient.class)
public DynamoDbAsyncClient asyncClient(DynamoDbAsyncClientBuilder builder) {
return super.asyncClient(builder);
}
Expand Down

0 comments on commit 4051b56

Please sign in to comment.