public <R> void send(String routingKey, CommandMessage<?> commandMessage, CommandCallback<R> callback)
throws Exception {
Assert.isTrue(awaitJoined(5, TimeUnit.SECONDS), "This Connector did not properly join the Cluster yet.");
String destination = consistentHash.getMember(routingKey, commandMessage.getPayloadType().getName());
if (destination == null) {
throw new CommandDispatchException("No node known to accept " + commandMessage.getPayloadType().getName());
}
Address dest = getAddress(destination);
callbacks.put(commandMessage.getIdentifier(), new MemberAwareCommandCallback<R>(dest, callback));
channel.send(dest, new DispatchMessage(commandMessage, serializer, true));
}