-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Using RedisTemplate in a MeterBinder causes a circular dependency #33488
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
Your issue is titled |
I've changed the title |
I can't reproduce this. If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem. |
I have create a complete minimal sample) on GitHub. You can direct run |
Your example uses Spring Boot 2.6.9, which is no longer supported. But this problem still persists in 2.7.6. It's working with Spring Boot 3.0.0 |
thanks |
I suspect #30636 is the reason this works in 3.0 but I'm not sure we can backport that fix to 2.x |
Well, I have noticed that in version 3.0 |
Approach to fix this incident:
See Spring Boot 2.6 Release Notes - Circular References Prohibited by Default. |
I'm going to mark this one as a duplicate of #30636 but unfortunately we don't think we can safely backport the fix for that. Users on Spring Boot 2.x should use the workaround documented above. |
Spring Boot Version
2.6.0+
How to Reproduce
Implments
MeterBinder
and injectRedisTemplate
Then I just launch the application, and Circular-References are created
Errors Output
I ended up having RedisTemplate injected into my business code using
@Lazy
The text was updated successfully, but these errors were encountered: