public void notifyClose() {
        log.debug("Set the metadata for next ShareFetch request to close the share session memberId={}",
                nextMetadata.memberId());
        nextMetadata = nextMetadata.finalEpoch();
    }
The client will initiate the session close on next ShareFetch request.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareSessionHandler.java