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

Expose builder for apache http5 #1444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gmellemstrand
Copy link

This relates to #1443

In additon to the build method, I've added a new public method which adds the http tracing to the builder. This new method can be called instead of the build method in the builder is required in order to add additional options before building. The functionality should be identical for current users.

@codefromthecrypt
Copy link
Member

@reta @kojilin can you consider this when updating httpclient5 for the 5.4 break?

@@ -43,15 +43,19 @@ public static HttpClient5Tracing newBuilder(HttpTracing httpTracing) {
return new HttpClient5Tracing(httpTracing);
}

public HttpClientBuilder addTracingToBuilder(HttpClientBuilder builder) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmellemstrand I believe, adding additional method like this would introduce conflicting (addTracingToBuilder vs build) instrumentation and confusion (when addTracingToBuilder should be used and why). I would recommend to have a factory method instead, fe:

Suggested change
public HttpClientBuilder addTracingToBuilder(HttpClientBuilder builder) {
public static HttpClient5CustomTracing newBuilder(HttpTracing httpTracing, HttpClientBuilder builder) {
return new HttpClient5CustomTracing(httpTracing, builder);
}

In this case the HttpClient5CustomTracing type would take care of adding tracing to the provided HttpClientBuilder as well as having a build() method with no args.

@codefromthecrypt does it make sense to you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants