protected boolean flushLastRequest(Partition partition) {
        boolean needReConsume = true;
        try {
            ClientBroker.CommitOffsetResponseB2C commitResponse =
                    getBrokerService(partition.getBroker())
                            .consumerCommitC2B(createBrokerCommitRequest(partition, true),
                                    AddressUtils.getLocalAddress(), consumerConfig.isTlsEnable());
            if (commitResponse != null && commitResponse.getSuccess()) {
                needReConsume = false;
            }
        } catch (Throwable e) {
            logger.error(new StringBuilder(256)
                    .append("flushLastRequest, commit ")
                    .append(partition.getTopic()).append("#")
                    .append(partition.getPartitionId())
                    .append(" offset failed.").toString(), e);
        }
        return needReConsume;
    }
Flush last request on a partition.

@param partition partition to do the flush operation
@return need to reconsume or not
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/consumer/BaseMessageConsumer.java