Ability to set custom interceptor on client via additionalSettings (HttpClientFactoryAdditionalSettings) or another clean way.
まだ誰も着手していません。
評価
調査の方向性
まず ApiClient と HttpClientFactoryAdditionalSettings を読み、呼び出しごとのクライアントがどのように構築されるか、また logger と retry の interceptor がどのように提供されるかに注目します。呼び出し元が reflection を使わずに再利用可能なカスタム interceptor を追加できる、サポートされた方法(要求されたアクセスまたは injection の経路を含む)が用意された時点で、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi,
previously in 0.81 and lower versions it was possible to do something like so
apiClient.setHttpClient(
apiClient
.getHttpClient()
.newBuilder()
.addInterceptor(new ApiClientDebugModeInterceptor())
.build());
add a custom interceptor and use that to gather debug info etc (not just logging to logger/or retry metrics etc)..
since 0.82 client creation is per call level and it has change to only allow
HttpClientFactoryAdditionalSettings to set a http logger and one for retry interceptor
and also this additionalSettings is a private field in ApiClient
so there is no way to pass in a custom interceptor to be added to the client builder phase (per request or as a class field to be re used).
I would like to request support to allow ApiClient users to
have access to this additionalSettings via a getter or have a way to pass in a vanilla Interceptor to be added to the call chain to do other custom work outside of logging/retry (in our case for example we have a debug mode where we gather headers/request body/response body and store it in some fields and do some debug logic from said object).
I can technically use reflections and access this additionalSettings and then instead of the custom retry interceptor use my own interceptor but that is not clean.
- 主要言語
- Java
- スター
- 29
- フォーク
- 50
- 平均マージ
- 1時間 30分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CyberSource/cybersource-rest-client-java のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
CyberSource/cybersource-rest-client-java#235 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
CyberSource/cybersource-rest-client-java#218 · コメント 1 件 ·
CyberSource/cybersource-rest-client-java の issue をすべて見る
似ている issue
-
[BUG] 增量 SSE 解析器未识别单独 CR 换行,导致事件无法及时交付対応中かも @king-wwwhhh が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
langchain4j/langchain4j#6669 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenAPITools/openapi-generator#25237 ·
メンテナーはふだん 1 日以内に返信
-
needs-area-label
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
quelea-projection/Quelea#711 ·
-
bug pdd
難易度 2/5 1時間未満 初心者へのやさしさ 67/100
objectionary/eo#9450 ·
メンテナーはふだん 1 日以内に返信