Interface CommandRouter


public interface CommandRouter
Interface describing a mechanism used to find a suitable member of a cluster capable of handling given command message.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the member instance to which the given message should be routed.
    void
    updateMembership(int loadFactor, CommandMessageFilter commandFilter)
    Updates the load factor and capabilities of this member representing the current endpoint if the implementation allows memberships to be updated dynamically.
  • Method Details

    • findDestination

      Optional<Member> findDestination(CommandMessage<?> message)
      Returns the member instance to which the given message should be routed. If no suitable member could be found an empty Optional is returned.
      Parameters:
      message - the command message to find a member for
      Returns:
      the member that should handle the message or an empty Optional if no suitable member was found
    • updateMembership

      void updateMembership(int loadFactor, CommandMessageFilter commandFilter)
      Updates the load factor and capabilities of this member representing the current endpoint if the implementation allows memberships to be updated dynamically.
      Parameters:
      loadFactor - the new load factor of the member for this endpoint
      commandFilter - the new capabilities of the member for this endpoint