Hi Spring Team, I would like to propose making org.springframework.web.service.invoker.HttpServiceProxyFactory.Builder non-final to allow for extension and customization of the builder process.

Use Case: In our projects, we provide the HttpServiceProxyFactory.Builder as a prototype-scoped bean that is used whenever @HttpExchange is configured. We need to collect and track all endpoints that are configured for HttpExchange classes across our application for monitoring and documentation purposes. This involves: 1. Scanning classes annotated with @HttpExchange to check their base URLs 2. Capturing endpoint information from rest clients configured through the builder 3. Maintaining a centralized registry of all Http service endpoints

Limitation: While we can scan HttpExchange classes for base urls, we cannot capture the complete picture because the Builder class is final, preventing us from extending it.

Comment From: bclozel

Would this enhancement cover the use case you are trying to implement? https://github.com/spring-projects/spring-framework/issues/33992

Comment From: bduisenov

Thank you for pointing me to that issue @bclozel. While the proposed registry and DSL enhancement would be valuable, I believe it addresses a different aspect of Http service proxy configuration than my use case. My use case is focused on the post-configuration phase, specifically: - collecting and tracking already configured endpoints and their associated Http service proxies - building a runtime registry of configured endpoints

While both enhancements deal with HttpServiceProxyFactory, they serve different purposes - the proposed registry helps with setting up proxies, while my request aims to enable tracking of the configured proxies during or after they're set up.

Would it make sense to consider both enhancements, perhaps with the builder extensibility being a smaller, more focused change that could complement the larger registry/DSL enhancement?

Comment From: rstoyanchev

There aren't that many methods on the factory and the builder, and while it's good to know the use case, it's not very clear which methods you mean to extend or why the builder in particular.

I don't think opening the factory or its builder for extension is a good direction, but would consider exposing information from it, or adding flexibility that might help your use case. For example we could keep track of the service types for which clients have been created and expose that, or provide a callback on every call to createClient.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.