Better customization options for the underlying HTTP client
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Read _DefaultConnectionContext and the DefaultConnectionContext.builder entry point to understand how the reactor-netty HttpClient is assembled. Compare the proposed metrics options with the additionalHttpClientConfiguration hook, then identify existing client-building tests; done means callers can customize the underlying client without replacing the complete construction logic.
Written by the indexing model from the issue text.
Description
We're using the CF Java client under a fairly high load (tens of thousands of requests per day) and we would like to enable the metrics feature of reactor-netty, so that we can see how many connections are used at any point in time:
return createHttpClient().compress(true) // Code taken from _DefaultConnectionContext.java
.tcpConfiguration(this::configureTcpClient)
.secure(this::configureSsl)
.metrics(true, new CustomHttpClientMetricsRecorder());
This is currently not possible unless we also override the entire reactor-netty client via DefaultConnectionContext.builder().httpClient(...), which we don't want to do, because it would involve to copy-pasting the entire HttpClient building logic from _DefaultConnectionContext. I could make a pull request that allows users of the CF Java client to do:
DefaultConnectionContext.builder()
.metrics(true) // OR
.metrics(true, new CustomHttpClientMetricsRecorder())
.build();
But I also don't particularly like that idea, because this doesn't cover any future features that the rector-netty devs may implement (or already have implemented). Maybe something like the following would be best?
DefaultConnectionContext.builder()
.additionalHttpClientConfiguration(httpClient -> httpClient.metrics(true) // OR
.metrics(true, new CustomHttpClientMetricsRecorder()))
.build();
What do you think?
- Dominant language
- Java
- Stars
- 334
- Forks
- 319
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudfoundry/cf-java-client
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
cloudfoundry/cf-java-client#1374 ·
-
Integration tests fail: test-service-broker.jar incompatible with java-buildpack v5 (JDK 17 default) Open
Difficulty 2/5 Half a day Newbie friendliness 74/100
cloudfoundry/cf-java-client#1344 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
cloudfoundry/cf-java-client#1373 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
cloudfoundry/cf-java-client#1370 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
cloudfoundry/cf-java-client#1367 ·
All issues in cloudfoundry/cf-java-client
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100