-
Notifications
You must be signed in to change notification settings - Fork 797
Document issues when using Spring FactoryBean and Spring Cloud OpenFeign Clients #1009
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
Comments
@jonatan-ivanov, could you take a look at this issue? |
Thank you for the issue and extra thanks for providing a reproducer!
Exact event:
This is a problem since in Boot's auto-config I guess one workaround could be creating and configuring the registry on your own the same way Boot does (see |
Thanks @jonatan-ivanov. There was actually a bug in Spring Cloud Commons that caused bean postprocessing issues. @raul-avila-ph Please upgrade to Spring Cloud Commons |
Thanks for taking a look. We tried upgrading Spring Cloud Commons to version We then tried the solution proposed by @jonatan-ivanov. This can be found in a separate branch in our project (https://github.com/raul-avila-ph/tracing-issue/tree/fix-observation-registry). This solves the problem, however we're not entirely happy with the workaround, because we can't replicate what the autoconfiguration does entirely, as the class |
@jonatan-ivanov could you please take a look? |
I guess the other thing you can do is copying that class (still not optimal) or asking the Boot team to make it public (still a hack/workaround). |
Thanks for your response. Should I create the issue somewhere else? It'd be great to have this problem solved at some point, but I don't want to create unnecessary noise in other Spring projects. |
Thanks a lot @raul-avila-ph, @jonatan-ivanov. I have done some debugging to verify why there's an issue with the To summarise, with the current programming model, there's no way to correctly create Feign client beans declared as fields in |
Bug description
We found a problem where Micrometer tracing propagation stops working when a Feign client is injected to a Spring FactoryBean.
Steps to reproduce:
We would expect Micrometer traces to continue working. With the setup explained above it stopped working.
Sample
We have created a small sample project reproducing the issue, it can be found here: https://github.com/raul-avila-ph/tracing-issue/
The project contains a single test that passes only when tracing is working properly. The code in
master
has the test failing, while you can see there is a branch calledwithout-factory-bean
that basically removes the FactoryBean and instantiates the service with@Service
. The test in this branch works, so tracing is not broken under these conditions.Please note that this problem occurs when Feign client is a transitive dependency of the Spring FactoryBean as well, we have just injected it directly in the sample code for simplicity.
The text was updated successfully, but these errors were encountered: