refactor: adds Client/Reqeust customizer for HttpClientSseClientTransport#117
Conversation
…SseClientTransport
| * @param baseUri the base URI of the MCP server | ||
| */ | ||
| public Builder(String baseUri) { | ||
| Builder(String baseUri) { |
There was a problem hiding this comment.
We need to deprecate it first in order to avoid breaking the users. It is currently public.
There was a problem hiding this comment.
You're absolutely right — to avoid breaking existing users, I've marked all currently public constructors as @Deprecated and added clear Javadoc indicating that they will be removed in a future release.
In addition, I introduced an alternative package-private constructor, which will be used in the new builder-based approach.
chemicL
left a comment
There was a problem hiding this comment.
Left some comments around backwards compatibility, but this is a useful change, thanks!
| */ | ||
| public HttpClientSseClientTransport(HttpClient.Builder clientBuilder, HttpRequest.Builder requestBuilder, | ||
| String baseUri, String sseEndpoint, ObjectMapper objectMapper) { | ||
| HttpClientSseClientTransport(HttpClient httpClient, HttpRequest.Builder requestBuilder, String baseUri, |
There was a problem hiding this comment.
We need to deprecate it first in order to avoid breaking the users. It is currently public.
There was a problem hiding this comment.
You're absolutely right — to avoid breaking existing users, I've marked all currently public constructors as @Deprecated and added clear Javadoc indicating that they will be removed in a future release.
In addition, I introduced an alternative package-private constructor, which will be used in the new builder-based approach.
…customization API (#117) - Add builder customizeClient() and customizeRequest() methods - Enable HTTP client and request configuration through consumer-based customization - Deprecate direct constructors in favor of the more flexible builder approach - Add test coverage for customization capabilities Co-authored-by: Christian Tzolov <christian.tzolov@broadcom.com> Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
…
This PR improves the construction pattern for HttpClientSseClientTransport by enforcing usage via a builder. It also introduces support for customizing HttpClient.Builder and HttpRequest.Builder before the transport is created. This provides a cleaner, more extensible way to configure HTTP behavior. Related to issue
Motivation and Context
I came across this project and really liked its design and goals, so I wanted to start contributing.
How Has This Been Tested?
Breaking Changes
Yes — this change makes the constructor for HttpClientSseClientTransport protected/private, which is a breaking change for users relying on direct instantiation.
To migrate, users should use the new builder-based approach for constructing HttpClientSseClientTransport.
Types of changes
Checklist
Additional context
let me know if i missed something and need to add or if these changes don't make sense no problem just close this pr :-)