Class RoutingKeyUtils

java.lang.Object
org.axonframework.modelling.entity.annotation.RoutingKeyUtils

@Internal public class RoutingKeyUtils extends Object
Utility class for retrieving routing keys from entity members and child entities.
Since:
5.0.0
Author:
Mitchell Herrijgers
  • Method Details

    • getMessageRoutingKey

      public static Optional<String> getMessageRoutingKey(@Nonnull AnnotatedElement member)
      Retrieves the routing key for the given member, which is defined by the EntityMember.routingKey() annotation.
      Parameters:
      member - The member to retrieve the routing key for.
      Returns:
      An Optional containing the routing key if present, otherwise empty.
    • getEntityRoutingKey

      public static Optional<String> getEntityRoutingKey(@Nonnull Class<?> childEntityClass)
      Retrieves the routing key property for the given child entity class, which is defined by the RoutingKey annotation on one of its fields.
      Parameters:
      childEntityClass - The class of the child entity to retrieve the routing key property for.
      Returns:
      An Optional containing the name of the routing key property if present, otherwise empty.