Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making HttpServiceProxyFactory.Builder extensible for custom configuration tracking #34144

Open
bduisenov opened this issue Dec 23, 2024 · 4 comments
Labels
status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@bduisenov
Copy link

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 23, 2024
@bclozel
Copy link
Member

bclozel commented Dec 23, 2024

Would this enhancement cover the use case you are trying to implement? #33992

@bclozel bclozel added the status: waiting-for-feedback We need additional information before we can continue label Dec 23, 2024
@bduisenov
Copy link
Author

bduisenov commented Dec 23, 2024

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?

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 23, 2024
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Dec 30, 2024

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.

@rstoyanchev rstoyanchev added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Dec 30, 2024
@spring-projects-issues
Copy link
Collaborator

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.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

No branches or pull requests

4 participants