[Spring] Fix native Key Vault binding and Binder/JMS initialization #51271
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #51271"
general
weight: 0.35
arnabnandy7
1. Summary
Fixes Azure/azure-sdk-for-java#51209.
Fix native Key Vault property-source binding, retain global properties in
AOT-generated contexts, and complete the Service Bus JMS initialization paths
exercised by the Queue sample. This PR remains a draft.
Thanks to @arnabnandy7 for Azure/azure-sdk-for-java#51238. The imported contribution
retains its original Author, AuthorDate, and Signed-off-by.
2. Changes
2.1. Key Vault and shared properties
implementation.SpringCloudAzureAutoconfigureRuntimeHints.Environment post-processors bind these directly, outside configuration-bean
registration.
SecretItemandSecretBundle.AzureIdentityEnvVarsconstructor independently of Key Vault:other services also initialize Azure Identity when the Secrets SDK is absent.
PropertiesFactory.buildPropertiesbean definition and remove the old AOTexclusion filter.
and parent/child isolation. Add generated-context tests for both Service Bus
and Event Hubs Binders; their added
spring-core-testdependencies are test-only.2.2. Other manual-binding paths
Register these additional binding roots:
| Properties | Why explicit hints are needed |
| --- | --- |
|
AzureJdbcPasswordlessProperties| A JDBC bean post-processor binds it directly; it is not a configuration-properties bean. ||
AzureCosmosProperties,AzureEventHubsProperties,AzureServiceBusProperties,AzureStorageBlobProperties,AzureStorageQueueProperties| Their ConnectionDetails factories use Binder without@ConfigurationProperties. Automatic hints from the alternative ordinary factory do not cover this branch. |new/Bindable.ofInstancedoes not preserve the reflective property accessors.Registrations are conditional on optional SDK classes; this is not blanket
registration of every properties class.
2.3. Service Bus JMS follow-up
with analyzable factory-method bean definitions.
user-provided instance factories, ordered customizers, cache/pool settings and
the pool's
stopdestruction method.factory/extensionMapfields used by the Standard-tier AMQP customizer.for
amqps,failover, SSL transport, PLAIN/ANONYMOUS SASL and default nooptracing. These descriptors are not ordinary Java ServiceLoader files.
Spring caching creates from concrete JMS capabilities.
TypeReferencevalues for optional JMS interfaces ratherthan production imports/class literals. Register only when the relevant
dependencies are present.
No public API or runtime dependency versions are changed. User-facing fixes are
recorded in the central Spring changelog.
3. Failure reference
These are separate failures encountered as native initialization progressed:
| Path | Observed error / symptom |
| --- | --- |
| Key Vault binding |
Skip configuring Key Vault PropertySource because spring.cloud.azure.keyvault.secret.property-sources is empty.|| Azure Identity |
ExceptionInInitializerErrorcaused by NPE inIdentityClientOptions.loadFromConfiguration(tested Identity 1.18.4). || Secret deserialization |
InvalidDefinitionException: Cannot construct instance of ...SecretItemin a native image. || Binder child context |
No qualifying bean of type ...AzureGlobalPropertiesrequired by credential auto-configuration. || JMS AOT |
Error processing bean with name 'jmsConnectionFactory': instance supplier is not supported(also pooling). || Qpid URI binding |
Unused parameters=[{prefetchPolicy.all=0}]. This connection factory cannot be started.|| Standard-tier customization |
Field factory can't found on class ...ServiceBusJmsConnectionFactory; the followingextensionMapaccess needs metadata too. || Qpid provider discovery |
Provider scheme NOT recognized: [failover], caused by missingMETA-INF/services/org/apache/qpid/jms/provider/failover. || Cached JMS sending |
MissingReflectionRegistrationErrorfor a proxy implementingjakarta.jms.Connection. |The JDBC path also reproduced a missing
AzureJdbcPasswordlessPropertiesconstructor; the five ConnectionDetails paths reproduced missing property
accessors. Their binding hints cover constructors, accessors and nested types.
4. Validation
2026-11-20 main synchronization: merged
e3d46ee89df351b0f2ff40a1c954262101d5ad3dwithout rewriting PR history. The only conflict was the central Spring changelog; both sets of entries are retained, and this PR's implementation is unchanged. The merged reactor passes 214 focused Java tests (213 passed, 1 existing skip), Checkstyle and scoped SpotBugs. The full native build was not rerun for this synchronization; native results below describe the earlier validated artifacts.4.1. Automated and isolated checks
Includes 42 registrar tests and real AOT generation, compilation and execution
for all three JMS factory branches.
subclass, ordered customizers, cache/pool settings and actual pool shutdown.
before the corresponding fixes. Existing factory/auto-configuration tests pass.
No rules were relaxed.
optional JMS JARs; loading it on the reduced classpath succeeds too.
optional-interface refactor, including no-JMS classpaths and Key Vault /
passwordless filter combinations.
real JMS factory/fallback classpaths, and 28 optional-service metadata scenarios.
runs with application-supplied candidate hints disabled.
4.2. Real native samples
SCA 7.5.0-beta.1; tested with azure-servicebus-jms 2.1.0 / Qpid 2.9.0.
Two independent native processes each waited at least ten seconds after startup,
returned HTTP 200 for a unique POST, and logged receipt of that exact message.
The application processes were stopped afterward. Private connection settings
and raw logs are not included in this PR.
application-owned
UserObjectMessage payload needshints.serialization().registerType(User.class). This was added only in theseparate local samples worktree, without changing its converter or trust rules.
The SDK must not hard-code application payload classes.
succeeded. This sample POM adjustment is also outside this SDK PR.
metadata-equivalence checks above verify that refactor without claiming another
full native rebuild.
correct Binder and reports
binderCreated=true(Boot 4.1.2).with a vault property source present and the secret matching the vault, without
application-provided Azure hints.
Focused checks do not replace the full-repository suite or a Linux native run.
Whole-module coverage thresholds and documentation generation were skipped for
the targeted local builds.
5. Known limits and separate issues
SDK classes and unsigned AOT classes generated in the same package can trigger:
This was reproduced with SCA 7.4.0. Passing native tests with local unsigned
development artifacts does not prove that signed releases work. This PR does
not remove signatures or disable verification.
it is not treated as an unqualified complete API compatibility guarantee.
Without the Blob SDK its full hint registration is skipped to avoid resolving
unavailable types; Event Hubs-only native binding without Blob is not verified.
described above, not every authentication, WebSocket, tracing or JMS feature.
Application payload serialization metadata remains the application's concern.