Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Ability to set custom interceptor on client via additionalSettings (HttpClientFactoryAdditionalSettings) or another clean way.

オープン
#241 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java
領域
api

調査の方向性

まず 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CyberSource/cybersource-rest-client-java のほかの issue

CyberSource/cybersource-rest-client-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。