Class AnnotatedEntityModelRoutingKeyMatcher<E>
java.lang.Object
org.axonframework.modelling.entity.annotation.AnnotatedEntityModelRoutingKeyMatcher<E>
- Type Parameters:
E- The type of the entity this matcher is used for.
Utility class that matches an entity instance to a message based on the routing key of a message and the routing key
of the entity. The expected payload type of the message is requested from the
AnnotatedEntityMetamodel to be
able to resolve the payload and extract the requested properties. Once extracted, both routing keys are then compared
for a match.- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotatedEntityModelRoutingKeyMatcher(AnnotatedEntityMetamodel<E> metamodel, String entityRoutingProperty, String messageRoutingProperty) Constructs anAnnotatedEntityModelRoutingKeyMatcherthat matches the routing key of the givenentityagainst the routing key of a message. -
Method Summary
-
Constructor Details
-
AnnotatedEntityModelRoutingKeyMatcher
public AnnotatedEntityModelRoutingKeyMatcher(@Nonnull AnnotatedEntityMetamodel<E> metamodel, @Nonnull String entityRoutingProperty, @Nonnull String messageRoutingProperty) Constructs anAnnotatedEntityModelRoutingKeyMatcherthat matches the routing key of the givenentityagainst the routing key of a message. The routing key of the entity is determined by theentityRoutingPropertyand the routing key of the message is determined by themessageRoutingProperty.- Parameters:
metamodel- TheAnnotatedEntityMetamodelof the entity to match against.entityRoutingProperty- The routing key property of the entity, which is used to match against the message routing key.messageRoutingProperty- The routing key property of the message, which is used to match against the entity routing key.
-
-
Method Details
-
matches
Matches the given entity against the provided message based on the routing keys of both. The routing key of the message is extracted from the expected payload type of the message, and compared to the routing key of the entity.- Parameters:
entity- The entity to match against.message- The message to match against.- Returns:
trueif the routing keys match,falseotherwise.
-