Class BrokerRouting
java.lang.Object
org.springframework.modulith.events.support.BrokerRouting
- Direct Known Subclasses:
BrokerRouting.SpelBrokerRouting
A
BrokerRouting
supports RoutingTarget
instances that contain values matching the format
$target::$key
for which the key can actually be a SpEL expression.- Since:
- 1.1
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
ABrokerRouting
that evaluates aRoutingTarget
's key as SpEL expression. -
Method Summary
Modifier and TypeMethodDescriptionResolves the routing key against the given event.Returns the actual routing target.static BrokerRouting
of
(RoutingTarget target, EvaluationContext context)
-
Method Details
-
of
- Parameters:
target
- must not be null.context
- must not be null.- Returns:
- will never be null.
-
getTarget
Returns the actual routing target.- Returns:
- will never be null.
-
getKey
Resolves the routing key against the given event. In case the originalRoutingTarget
contained an expression, the event will be used as root object to evaluate that expression.- Parameters:
event
- must not be null.- Returns:
- can be null.
-