-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client delegation stopped working #1033
Comments
Hello @kubav182, thanks for creating the issue. It seems that, it's not related in any way to Spring Cloud code, but rather Spring Framework. I can double-check that for you, but in order for us to do it, please provide a minimal, complete, verifiable example that reproduces the issue. |
@OlgaMaciaszek Hello Olga, I'm quite sure it is caused by FeignAutoConfiguration class. This class uses condition for every client, there is for example OkHttpClient:
As I'm creating Client there is no Client created by autoconfig (ConditionalOnMissingBean). So I'm injecting Client in method where I'm creating it so it is circle. Only solution for me was duplicate code from FeignAutoConfiguration and create client myself, but it depends on what client I'm using if okhttp, apache etc. I'm not sure if it is bug or not, but as I wrote I could do that with cloud version 2021.x. |
Hello @kubav182, we've made some breaking changes in this area in a major release, so it might have been on purpose. However, I will double-check that for you, but please provide your sample as a link to a GH repo, as the sample you've provided doesn't seem to open correctly on a Linux machine. |
@OlgaMaciaszek Hello I pushed project to public repo https://github.com/kubav182/demo-feign-client-delegation-bug/tree/master |
Thanks @kubav182. Can you specify on which version that used to work? When I've downgraded this to Cloud In terms of the interceptors, those are the ones you can use, but they are from the external Feign library, so any changes would have to be reported/ added in that repo. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
In previous cloud versions 2021.x I could make Client delegation like
Now in version 2023.0.1 I'm getting error Client bean is in creation, so there is circular dependency.
I used it as interceptor around request/response. I understand there is RequestInterceptor and ResponseInterceptor. But RequestInterceptor just decorates RestTemplate and ResponseInterceptor does not contain for example request duration.
Is it bug or is there any other easy way how to get info about request/response + duration? I want to log this info to metric system.
The text was updated successfully, but these errors were encountered: