diff --git a/extensions/amazon-services/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AmazonServicesClientsProcessor.java b/extensions/amazon-services/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AmazonServicesClientsProcessor.java index 204f2c50f0a9f..585b7c4fb5c36 100644 --- a/extensions/amazon-services/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AmazonServicesClientsProcessor.java +++ b/extensions/amazon-services/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AmazonServicesClientsProcessor.java @@ -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; @@ -43,6 +44,13 @@ void awsAppArchiveMarkers(BuildProducer producer) { + // FullJitterBackoffStrategy uses j.u.Ramdom, so needs to be runtime-initialized + producer.produce( + new RuntimeInitializedClassBuildItem("software.amazon.awssdk.core.retry.backoff.FullJitterBackoffStrategy")); + } + @BuildStep void setup(CombinedIndexBuildItem combinedIndexBuildItem, List amazonClients, diff --git a/extensions/amazon-services/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java b/extensions/amazon-services/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java index 6a2e0d57d33c0..77f5a558ac678 100644 --- a/extensions/amazon-services/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java +++ b/extensions/amazon-services/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java @@ -31,6 +31,7 @@ import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.ShutdownContextBuildItem; +import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient; import software.amazon.awssdk.services.dynamodb.DynamoDbClient; @@ -68,6 +69,14 @@ AdditionalBeanBuildItem producer() { return AdditionalBeanBuildItem.unremovableOf(DynamodbClientProducer.class); } + @BuildStep + void runtimeInitialize(BuildProducer producer) { + // 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 setup(BeanRegistrationPhaseBuildItem beanRegistrationPhase, BuildProducer extensionSslNativeSupport,