@Override
    public boolean disconnectFromPartition(String partitionKey,
            ProcessResult result) throws TubeClientException {
        if (result == null) {
            throw new TubeClientException("Illegal parameter: parameter result is null!");
        }
        final StringBuilder sBuffer = new StringBuilder(512);
        if (TStringUtils.isBlank(partitionKey)) {
            result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                    "Parameter partitionKey is blank!");
            return result.isSuccess();
        }
        if (isShutdown()) {
            result.setFailResult(TErrCodeConstants.CLIENT_SHUTDOWN,
                    "The client is not started or closed!");
            return result.isSuccess();
        }
        if (!clientRmtDataCache.isPartitionInUse(partitionKey)) {
            result.setSuccResult();
            return result.isSuccess();
        }
        clientRmtDataCache.removeAndGetPartition(partitionKey,
                this.consumerConfig.getPullRebConfirmWaitPeriodMs(),
                this.consumerConfig.isPullRebConfirmTimeoutRollBack(), result, sBuffer);
        PartitionExt partitionExt = (PartitionExt) result.getRetData();
        if (partitionExt == null) {
            result.setSuccResult();
            return result.isSuccess();
        }
        unregisterPartition(partitionExt, partitionExt.isLastPackConsumed(), sBuffer);
        result.setSuccResult();
        return result.isSuccess();
    }
Initial a client-balance consumer object
@param messageSessionFactory   the session factory
@param consumerConfig          the consumer configure
@throws TubeClientException    the exception while creating object.
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/consumer/SimpleClientBalanceConsumer.java