@Override public Optional<Member> findDestination(CommandMessage<?> message) { String routingKey = routingStrategy.getRoutingKey(message); return consistentHash.get().getMember(routingKey, message); }
@Override public Optional<Member> findDestination(CommandMessage<?> message) { String routingKey = routingStrategy.getRoutingKey(message); return consistentHash.get().getMember(routingKey, message); }
@Override public Optional<Member> findDestination(CommandMessage<?> commandMessage) { return atomicConsistentHash.get().getMember(routingStrategy.getRoutingKey(commandMessage), commandMessage); }
private Address resolveDestination(String routingKey, CommandMessage<?> commandMessage) throws InterruptedException { Assert.isTrue(awaitJoined(5, TimeUnit.SECONDS), "This Connector did not properly join the Cluster yet."); String destination = consistentHash.get().getMember(routingKey, commandMessage.getCommandName()); if (destination == null) { throw new CommandDispatchException("No node known to accept " + commandMessage.getCommandName()); } return getAddress(destination); }