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
Replace SpringPrototypeAggregateFactory
BeanDefinition
introspection for direct method invocation
#2637
Conversation
For some reason, Spring Framework logs the following message open usages of the static factory method of the SpringPrototypeAggregateFactory: LocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.axonframework. spring.eventsourcing.SpringPrototypeAggregateFactory Although none of the methods are marked deprecated on the BeanDefinition API, apparently this is undesired behavior. Regardless, we can easily use a Supplier<SpringPrototypeAggregateFactory> in this case, since the required properties for the factory are known upfront. #2630
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
Unfortunately, this approach is not compatible with Spring AOT, nor Spring Native. |
Looking at the code, I feel this is a slight variation of the Spring issue that is referred to in the original Axon issue. In this case, it's not a constructor, but a static method that's being used. In either case, it shouldn't use parameter names, as the parameters are defined based on index name. @smcvb , I would suggest reverting the merge of this PR. It doesn't look like our bug |
Thanks for investigating the support on Spring AOT, @abuijze. In the meantime, I think it is safe to assume the warning is not impacting our users. Nudging @nils-christian here, as he's the constructor of the issue. |
Note that a follow-up issue has just been created by Sébastien Deleuze concerning this warning, which you can find here. |
For some reason, Spring Framework logs the following message open usages of the static factory method of the
SpringPrototypeAggregateFactory
inside theSpringAggregateLookup
component:LocalVariableTableParameterNameDiscoverer : Using deprecated '-debug' fallback for parameter name resolution. Compile the affected code with '-parameters' instead or avoid its introspection: org.axonframework.spring.eventsourcing.SpringPrototypeAggregateFactory
Although none of the methods are marked deprecated on the
BeanDefinition
API, we are, apparently, dealing with undesired behavior for Spring.Regardless, we can easily use a
Supplier<SpringPrototypeAggregateFactory>
in this case since the required properties (the aggregate name and its subtypes) for constructing theSpringPrototypeAggregateFactory
are known upfront.By switching from introspection to using a
Supplier
, we resolve #2630.