Class RoutingKeyEventTargetMatcher<E>
java.lang.Object
org.axonframework.modelling.entity.annotation.RoutingKeyEventTargetMatcher<E>
- Type Parameters:
E- The type of the child entity this matcher matches against.
- All Implemented Interfaces:
EventTargetMatcher<E>
EventTargetMatcher implementation that matches based on the routing key. If the routing key of the message
matches the routing key of the child entity, the child entity is considered a match.
Note: This class was known as {code org.axonframework.modelling.command.ForwardMatchingInstances} before version 5.0.0.
- Since:
- 3.1.0
- Author:
- Steven van Beelen, Mitchell Herrijgers
-
Constructor Summary
ConstructorsConstructorDescriptionRoutingKeyEventTargetMatcher(AnnotatedEntityMetamodel<E> metamodel, String entityRoutingProperty, String messageRoutingProperty) Constructs aRoutingKeyEventTargetMatcherthat matches the routing key of the givenentityagainst the routing key of an event message. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(E childEntity, EventMessage message, ProcessingContext processingContext)
-
Constructor Details
-
RoutingKeyEventTargetMatcher
public RoutingKeyEventTargetMatcher(@Nonnull AnnotatedEntityMetamodel<E> metamodel, @Nonnull String entityRoutingProperty, @Nonnull String messageRoutingProperty) Constructs aRoutingKeyEventTargetMatcherthat matches the routing key of the givenentityagainst the routing key of an event message. The routing key of the entity is determined by theentityRoutingPropertyand the routing key of the event 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.messageRoutingProperty- The routing key property of the message, which is used to match against the entity.
-
-
Method Details
-
matches
public boolean matches(@Nonnull E childEntity, @Nonnull EventMessage message, @Nonnull ProcessingContext processingContext) Description copied from interface:EventTargetMatcher- Specified by:
matchesin interfaceEventTargetMatcher<E>- Parameters:
childEntity- The entity of typeEto test.message- TheEventMessageto test.processingContext- TheProcessingContextin which the message is being processed.- Returns:
trueif the entity should be invoked for the message,falseotherwise.
-