Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Better customization options for the underlying HTTP client

未關閉
#1,024 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
30/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
java
領域
api, backend

研究方向

閱讀 _DefaultConnectionContext 和進入點 DefaultConnectionContext.builder,以了解 reactor-netty HttpClient 的組裝方式。將提議的 metrics 選項與 additionalHttpClientConfiguration hook 進行比較,然後找出現有的用戶端建構測試;完成的標準是呼叫端可以自訂底層用戶端,而不必替換完整的建構邏輯。

由索引模型根據 Issue 內容生成。

描述

enhancement reactor triaged

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,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

cloudfoundry/cf-java-client 的其他 Issue

查看 cloudfoundry/cf-java-client 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。