Regarding your initial question on the
does not contain a routing key exception you encountered, you must have noticed this trace originated from the
This is configured for you by default, and by default, will expect an @RoutingKey annotated field in the command message.
Note that the @TargetAggregateIdentifier annotation is meta-annotated with @RoutingKey.
You can configure the AnnotationRoutingStrategy to take different approach to the none-existence of a routing key in your command message.
This can be done by creating a AnnotationRoutingStrategy with another UnresolvedRoutingKeyPolicy.
The default UnresolvedRoutingKeyPolicy is ERROR, exactly why you’re seeing this message.
Consider using something like static or random in this scenario.
Additionally, I think it’s justified to clarify this in the documentation.
The notion is still correct, granted you’re not utilizing a distributed solution for the command bus (as in that scenario, there is no need for a Routing Strategy), but this should be made clear there.
Do you mind be more specific where the documentation states an Aggregate Identifier isn’t required for the Aggregate-Creation-Command, so that we may adjust this bit?
Looking forward to your response, and I of course hope this helps you out Sam!