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
SpringAxonAutoConfigurer warns about multiple beans defined for polymorphic aggregates. #2512
Comments
Thanks for filing this issue with us, @maverick1601! |
@smcvb just checked by upgrading to 4.6.x on a test branch and the warning still occurs. |
That's...curious. The Sorry for pressing here, but I need a little more to go for here. |
@smcvb you're right, I was to focused on the message itself. The message says for instance:
But as you pointed out, it's now originating from the |
The method used to retrieve the bean names, ListableBeanFactory#getBeanNamesForType(Class), will *always* return more than one entry if there are several beans of the given type or a subtype. The only reason those beans won't show, is if they're not annotated with @aggregate. And if they aren't, the polymorphic configuration wouldn't be polymorphic anyhow. As such, marking this log statement as warn was unnecessary to begin with. Resolves #2512
Closing this issue as resolved through commit a121e60. |
Basic information
Steps to reproduce
Define an aggregate hierarchy, as described in https://docs.axoniq.io/reference-guide/v/4.5/axon-framework/axon-framework-commands/modeling/aggregate-polymorphism and start up using Spring Axon auto configuration.
Expected behaviour
SpringAxonAutoConfigurer
should not log warnings about multiple beans of the same aggregate super type, since Axon requires us to annotate super classes as well, in order for the hierarchy to be properly detected.Actual behaviour
SpringAxonAutoConfigurer
usesbeanName(Class)
which logs warnings when more than one bean is defined, which is always the case for such hierarchies.The text was updated successfully, but these errors were encountered: