Class BrokerRouting

java.lang.Object
org.springframework.modulith.events.support.BrokerRouting
Direct Known Subclasses:
BrokerRouting.SpelBrokerRouting

public class BrokerRouting extends Object
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
  • Method Details

    • of

      public static BrokerRouting of(RoutingTarget target, EvaluationContext context)
      Creates a new BrokerRouting for the given RoutingTarget and EvaluationContext.
      Parameters:
      target - must not be null.
      context - must not be null.
      Returns:
      will never be null.
    • getTarget

      public String getTarget()
      Returns the actual routing target.
      Returns:
      will never be null.
    • getKey

      @Nullable public String getKey(Object event)
      Resolves the routing key against the given event. In case the original RoutingTarget 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.