Skip to content

Commit

Permalink
Runtime initialize amazon-services classes using j.u.Ramdom
Browse files Browse the repository at this point in the history
  • Loading branch information
jerboaa committed Mar 19, 2021
1 parent 69c1551 commit 6df32c0
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
import io.quarkus.deployment.configuration.ConfigurationError;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
Expand All @@ -37,6 +38,16 @@ void globalInterceptors(BuildProducer<AmazonClientInterceptorsPathBuildItem> pro
new AmazonClientInterceptorsPathBuildItem("software/amazon/awssdk/global/handlers/execution.interceptors"));
}

@BuildStep
void runtimeInitialize(BuildProducer<RuntimeInitializedClassBuildItem> producer) {
producer.produce(
new RuntimeInitializedClassBuildItem("software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy"));
// This class triggers initialization of FullJitterBackoffStragegy so needs to get runtime-initialized
// as well
producer.produce(
new RuntimeInitializedClassBuildItem("software.amazon.awssdk.services.dynamodb.DynamoDbRetryPolicy"));
}

@BuildStep
void awsAppArchiveMarkers(BuildProducer<AdditionalApplicationArchiveMarkerBuildItem> archiveMarker) {
archiveMarker.produce(new AdditionalApplicationArchiveMarkerBuildItem(AWS_SDK_APPLICATION_ARCHIVE_MARKERS));
Expand Down

0 comments on commit 6df32c0

Please sign in to comment.