cloudfoundry / cloudfoundry/cf-java-client
Better customization options for the underlying HTTP client
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 334
- フォーク
- 319
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
_DefaultConnectionContext と DefaultConnectionContext.builder のエントリポイントを読み、reactor-netty HttpClient がどのように組み立てられているかを理解します。提案されているメトリクスオプションを additionalHttpClientConfiguration フックと比較し、既存のクライアント構築テストを特定します。呼び出し元が完全な構築ロジックを置き換えずに基盤となるクライアントをカスタマイズできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- api, backend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100