-
Notifications
You must be signed in to change notification settings - Fork 38.4k
@Primary with Cyclic DI #27668
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
I think that this is working as expected. You can't inject a bean into itself so |
Well actually you can (as of Spring 4.3) so you can call a method on yourself so AOP is applied (instead of using |
Thanks @mdeinum, I wasn't aware of that. It looks like that will only work if there's not another candidate to inject. I'll re-open this issue and transfer it to the Framework team to check if the behavior is expected. |
the logic locates in |
I don't think you should be doing that at all for a start. Cycles are highly discouraged and the self-injection for AOP purpose is actually a design smell. We'll share more details in #28299 |
Version: spring-boot-2.5.6
Code:
Expect Print:
But Actual Print:
The text was updated successfully, but these errors were encountered: