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 TypeMethodDescriptionfindDestination(CommandMessage<?> message) Returns the member instance to which the givenmessageshould be routed.voidupdateMembership(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
Returns the member instance to which the givenmessageshould 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
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 endpointcommandFilter- the new capabilities of the member for this endpoint
-