diff --git a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md index 0a0e714bfba69..8523c6f5bc7bc 100644 --- a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md +++ b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md @@ -17,6 +17,7 @@ - Fixed per-call response timeout overrides incorrectly changing asynchronous response-body read timeouts. - Fixed response timeouts expiring during otherwise valid request-body uploads. - Fixed requests with `Expect: 100-continue` waiting indefinitely when a server sends neither an interim nor a final response. The configured response timeout now bounds the handshake wait independently of the upload. +- Added GraalVM native-image metadata (`reflect-config.json`, `native-image.properties`) so `JdkHttpClientProvider` is discoverable via `ServiceLoader` and its `GlobalJdkAsyncHttpClient` holder initializes at run time under a native image, mirroring the existing support in `azure-core-http-netty`. Previously, an application built with this module as its `HttpClientProvider` under GraalVM native-image could fail at run time with an `IllegalStateException` indicating that the default HttpClient provider could not be found on the classpath. ### Other Changes diff --git a/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/native-image.properties b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/native-image.properties new file mode 100644 index 0000000000000..290e31eb7ef0a --- /dev/null +++ b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/native-image.properties @@ -0,0 +1 @@ +Args=--initialize-at-run-time=com.azure.core.http.jdk.httpclient.JdkHttpClientProvider$GlobalJdkAsyncHttpClient diff --git a/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/reflect-config.json b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/reflect-config.json new file mode 100644 index 0000000000000..8acfb7c29e70f --- /dev/null +++ b/sdk/core/azure-core-http-jdk-httpclient/src/main/resources/META-INF/native-image/com.azure/azure-core-http-jdk-httpclient/reflect-config.json @@ -0,0 +1,8 @@ +[ + { + "name": "com.azure.core.http.jdk.httpclient.JdkHttpClientProvider", + "allDeclaredFields": true, + "queryAllDeclaredMethods": true, + "queryAllDeclaredConstructors": true + } +]