Ability to set custom interceptor on client via additionalSettings (HttpClientFactoryAdditionalSettings) or another clean way.
还没有人认领这个 Issue。
评估
调研方向
首先阅读 ApiClient 和 HttpClientFactoryAdditionalSettings,重点关注每次调用的客户端是如何构建的,以及 logger 和 retry 拦截器是如何提供的。当调用方拥有一种受支持的方式,可以在不使用 reflection 的情况下添加可复用的自定义拦截器,并包括所请求的访问或注入路径时,这项工作就完成了。
由索引模型根据 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 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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
-
False Negative: InnerTypeLastCheck does not report members declared after inner enums or annotations未关闭
难度 2/5 1-3 小时 新手友好度 78/100
checkstyle/checkstyle#22027 ·
维护者通常 1 天内回复
-
bug follow-up lane:auto
难度 2/5 1-3 小时 新手友好度 85/100
Sanne/incus-spawn#1497 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
[BUG][RUST] chrono date-time path/query/header params are not serialized as RFC 3339可能已有人在做 @teovillanueva 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
OpenAPITools/openapi-generator#25297 ·
维护者通常 1 天内回复
-
[CI] NettyClientTest.testServerDisconnection may fail with DisconnectException可能已有人在做 @yangshangqing95 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复