I’m trying to take advantage of the ApplicationContextLookupParameterResolverFactory’s ability to detect beans of type ParameterResolverFactory. It seems to be picking them up okay, but because the ACLPRF isn’t the ParameterResolverFactory passed in to the AnnotationEvenListenerBeanPostProcessor, it’s not actually getting used.
Do I need to manually construct the ACLPRF (passing in the classpath resolver) as a Spring bean then pass that into the AELBPP, or is there a more automated way to do so?
You can easilly create another bean with your own name. It doesn’t have to be a ‘real’ singleton. At least, you won’t depend on the obscure name I chose for the ‘standard’ instance.
Do you use the ApplicationContextLookupParameterResolverFactory in the test fixtures? Generally, the fixtures are meant to be lightweight. Just register your injectable parameters using the fixture. That doesn’t require the setup of an entire application context.
Looking at the fixtures, there is a little room for more customization of the parameter resolvers…
In our production Spring configuration, we have two instances of CommandBus. One is actually used to process commands, but another we call the “queryBus” where we route incoming requests to the read model. I believe at the time we had to drop the use of annotation-config as it was confused by having two CommandBus Spring beans in the application context.
In the axon:annotation-config element, you can specify a command bus. In that case, all command handler beans will be registered with that command bus. Maybe that helps.