@Override
    Node getRecipient(List<Mirror.Entry> choices) {
        if (choices.isEmpty()) return null;
        Mirror.Entry entry;
        NodeMetrics metrics;
        if (choices.size() == 1) {
            entry = choices.get(0);
            metrics = getNodeMetrics(entry);
        } else {
            int candA = random.nextInt(choices.size());
            int candB = random.nextInt(choices.size());
            while (candB == candA) {
                candB = random.nextInt(choices.size());
            }
            entry = choices.get(candA);
            Mirror.Entry entryB = choices.get(candB);
            metrics = getNodeMetrics(entry);
            NodeMetrics metricsB = getNodeMetrics(entryB);
            if (metrics.pending() > metricsB.pending()) {
                entry = entryB;
                metrics = metricsB;
            }
        }
        metrics.incSend();
        return new Node(entry, metrics);
    }
Will pick 2 random candidates and select the one with the least pending operations.

@author baldersheim
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/AdaptiveLoadBalancer.java