Comments

Our project is a Spring Boot application with hierarchical Spring contexts which depend on each other. As this creates cycles in some few cases, we let Spring inject providers for the dependencies instead of the dependencies directly. For this purpose we use the JSR330 provider interface.

This works fine in Spring beans, but not with Axon command handlers. Let's ignore the hierarchical context and assume we have a bean OrderService in our context. The following would work:

This comment has been minimized.

the support for injecting Spring beans in @CommandHandler annotated methods should not be considered a full-fledged JSR330 implementation. The Provider interface is not supported as a parameter value, at the moment. If you wish to use the OrderService inside a Command Handler, you should inject it as such (thus without the Provider).

If you know of an easy way to change the SpringBeanParameterResolver to support this, then I'd love to hear that.