Better customization options for the underlying HTTP client
還沒有人認領這個 Issue。
評估
研究方向
閱讀 _DefaultConnectionContext 和進入點 DefaultConnectionContext.builder,以了解 reactor-netty HttpClient 的組裝方式。將提議的 metrics 選項與 additionalHttpClientConfiguration hook 進行比較,然後找出現有的用戶端建構測試;完成的標準是呼叫端可以自訂底層用戶端,而不必替換完整的建構邏輯。
由索引模型根據 Issue 內容生成。
描述
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?
- 主要語言
- Java
- 星號
- 334
- 分支
- 318
- 平均合併
- 7 天 11 小時
- 30 天內合併 PR
- 3
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cloudfoundry/cf-java-client 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
cloudfoundry/cf-java-client#1374 ·
-
Integration tests fail: test-service-broker.jar incompatible with java-buildpack v5 (JDK 17 default)未關閉
難度 2/5 半天 新手友好度 74/100
cloudfoundry/cf-java-client#1344 · 1 則留言 ·
-
Execute integration tests in Github Actions可能已有人在做 @ZPascal 於 8 天前認領。 未關閉
cloudfoundry/cf-java-client#1380 · 1 個 reaction · 已指派 2 人 ·
-
難度 5/5 一週以上 新手友好度 15/100
cloudfoundry/cf-java-client#1373 ·
-
難度 3/5 1-2 天 新手友好度 55/100
cloudfoundry/cf-java-client#1370 ·
查看 cloudfoundry/cf-java-client 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
sqlcipher/sqlcipher-android#97 · 1 則留言 ·
-
bug IIIF interoperability
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 68/100
Netcracker/qubership-integration-platform#1046 ·
維護者通常 2 天內回覆