private KafkaChannel channel(SelectionKey key) {
        return (KafkaChannel) key.attachment();
    }
Get the channel associated with selectionKey
clients/src/main/java/org/apache/kafka/common/network/Selector.java