Upcasters are not executed in the desired order when using @Order annotation on Bean Creation Methods in a Spring Environment #1892
Labels
Priority 4: Would
Lowest priority. Would-be-nice to include issues when time allows it.
Status: Resolved
Use to signal that work on this issue is done.
Type: Enhancement
Use to signal an issue enhances an already existing feature of the project.
Milestone
This is a follow up of issue #1810.
Basic information
Steps to reproduce
Clone the referenced repository. It contains a Spring Boot application (de.rhocas.axontest.axontest.AxontestApplication).
The application imports a Spring configuration containing three upcaster beans whose orders are defined by using Spring's @order annotation.
Expected behaviour
Upcaster1 is invoked before Upcaster2 and Upcaster2 before Upcaster3.
Actual behaviour
The actual order cannot be determined, but is usually 3, 1, and 2 on my machine.
The problem is, that the solution for #1810 only works if the Order annotation is used on the classes and only if the bean type is the annotated class. The code in org.axonframework.spring.config.SpringAxonAutoConfigurer.registerEventUpcasters(Configurer) uses beanFactory.getType which would return org.axonframework.serialization.upcasting.event.EventUpcaster in my case. Even if I would define the beans with Upcaster1 etc. there would still be no annotation, as the annotation is on the bean declaration not on the bean class itself.
The text was updated successfully, but these errors were encountered: