Skip to content

Move endpoint resolution from interceptors to pipeline stage#6820

Merged
S-Saranya1 merged 8 commits intofeature/master/core-interceptors-migrationfrom
somepal/endpoint-resolution-refactoring
Apr 16, 2026
Merged

Move endpoint resolution from interceptors to pipeline stage#6820
S-Saranya1 merged 8 commits intofeature/master/core-interceptors-migrationfrom
somepal/endpoint-resolution-refactoring

Conversation

@S-Saranya1
Copy link
Copy Markdown

@S-Saranya1 S-Saranya1 commented Mar 26, 2026

Motivation and Context

The SDK uses ExecutionInterceptor for core endpoint resolution functionality. But this interface was
designed for customer extensibility, not internal SDK. This is Part 2 of the core interceptors migration, following the auth scheme resolution refactoring in #6755.

Modifications

1. Codegen — generate resolveEndpoint() in client classes

  • SyncClientClass, AsyncClientClass: Added resolveEndpoint() method generation containing service-specific endpoint resolution logic (param building, rules engine call, host prefix, auth scheme signer properties, business metrics).
  • JsonProtocolSpec, QueryProtocolSpec, XmlProtocolSpec: Pass callback via ClientExecutionParams.withEndpointResolver().
  • BaseClientBuilderClass: Removed endpoint interceptors from built-in interceptors list.

2. Codegen — generate per-service EndpointResolverUtils

  • EndpointResolverUtilsSpec: New codegen spec generating a per-service utility class (e.g., DynamoDbEndpointResolverUtils) with static helpers extracted from the old interceptor - ruleParams(), context params, host prefix, auth scheme property copying, metrics. Per-service because it references service-specific types.
  • EndpointRulesSpecUtils: Added helper methods for class name resolution.
  • EndpointProviderTasks: Generate EndpointResolverUtils instead of old interceptors.

3. Added EndpointResolutionStage

New pipeline stage in sdk-core that runs after AuthSchemeResolutionStage. Calls the service-specific callback, stores RESOLVED_ENDPOINT, copies endpoint headers, applies resolved URL, and reports ENDPOINT_RESOLVE_DURATION metric. Registered in both sync and async pipelines.

4. Added EndpointResolver interface and ClientExecutionParams

EndpointResolver functional interface in sdk-core, endpointResolver field on ClientExecutionParams, ENDPOINT_RESOLVER execution attribute, and wiring in AwsExecutionContextBuilder.

5. De-duplicated AwsEndpointProviderUtils

Created single shared class in aws-core replacing identical per-service generated copies. Deleted the AwsEndpointProviderUtils.java.resource template.

6. Updated S3 presigner and S3Utilities

Removed old endpoint interceptors from both. Added direct endpoint resolution methods that call S3EndpointResolverUtils.ruleParams() and apply the resolved URL.

7. Deleted dead code

Removed EndpointResolverInterceptorSpec, RequestEndpointInterceptorSpec, AuthSchemeInterceptorSpec, their tests, AwsEndpointProviderUtils.java.resource template, and dead generateAuthSchemeInterceptor() method.

Testing

  • Added EndpointResolutionStageTest - unit tests for the new pipeline stage
  • Verified existing functional tests for endpoint resolution behavior passing.
  • Modified codegen-fixture tests.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@S-Saranya1 S-Saranya1 requested a review from a team as a code owner March 26, 2026 15:28
@S-Saranya1 S-Saranya1 force-pushed the somepal/endpoint-resolution-refactoring branch from 87d0960 to 305ba3a Compare March 27, 2026 16:38
@S-Saranya1 S-Saranya1 force-pushed the somepal/endpoint-resolution-refactoring branch from 6000d9f to 7b09efe Compare March 27, 2026 17:15
@S-Saranya1 S-Saranya1 merged commit b417a87 into feature/master/core-interceptors-migration Apr 16, 2026
8 of 30 checks passed
@github-actions
Copy link
Copy Markdown

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants