Processing commands in AF5

hello
in AF4 commands are always directed to aggregates, if there are two commands sent in the same time to the same instance of aggregate they will be process sequentially (one by one)
how will this process look like in AF5 in terms of concurrency since there there will be no aggregates?

Hey @rsobies! Awesome to see you’re on the bleeding edge of what we’re discussing internally to! :slight_smile:

What is basically comes down to, is the necessity to have a “routing strategy” that routes consistently on every instance. In Axon Framework 4 (and 3 and 2, actually), the RoutingStrategy interface defaulted to the AnnotationRoutingStrategy. This implementation, in turn, looked for the @TargetAggregateIdentifier.

As of AF4, the AnnotationRoutingStrategy actually looks for the @RoutingKey annotation. The @TargetAggregateIdentifier is meta-annotated with this annotation.

As you have rightfully pointed out, AF5 will release its aggregate focus. This, however, does not release the necessity for consistent routing in a distributed scenario. Thus, the need for a routing key remain. As such, I am confident the RoutingStrategy interface will remain in AF5.

Depending on whether somebody wants to have an annotated application, he/she/they can use the AnnotationRoutingStrategy to look for the @RoutingKey annotation. We have recently discussed the idea of an @Command (and @Event and @Query) annotation to carry (command) message specifics. Things to contain in a class-level annotation like this, are the (business) names somebody would want for their message. For command, we could include the routing key there.

If the user would not want to use annotations, he/she/they will be required to construct a RoutingStrategy that, based on a command can deduce which field or getter in the command to use to set as the routing key.