private void queryGroupStoredOffsets(MessageStore msgStore, String groupName,
            long requestOffset, long recordStamp,
            int msgCount, int maxRetryCnt,
            StringBuilder strBuff) {
        int msgTypeCode;
        int partitionId;
        int msgAccCnt = 0;
        boolean msgMatched;
        Throwable qryThrow;
        GetMessageResult getMessageResult;
        // locate partitionId and filter-item
        msgTypeCode = groupName.hashCode();
        partitionId = Math.abs(msgTypeCode) % TServerConstants.OFFSET_HISTORY_NUMPARTS;
        // build filter conditions
        Set<String> filterCodes = new HashSet<>();
        filterCodes.add(groupName);
        // build consumer node information
        ConsumerNodeInfo consumerNodeInfo = new ConsumerNodeInfo(broker.getStoreManager(),
                groupName, "offsetConsumer", filterCodes, "", System.currentTimeMillis(), "", "");
        // query records from storage
        int qryRetryCount = 0;
        long itemInitOffset = requestOffset;
        int maxTransferSize = broker.getStoreManager().getMaxMsgTransferSize();
        do {
            qryThrow = null;
            try {
                getMessageResult = msgStore.getMessages(303, itemInitOffset,
                        partitionId, consumerNodeInfo, TServerConstants.OFFSET_HISTORY_NAME,
                        maxTransferSize, recordStamp);
            } catch (Throwable e2) {
                qryThrow = e2;
                continue;
            }
            // check query result
            if (getMessageResult.transferedMessageList == null
                    || getMessageResult.transferedMessageList.isEmpty()) {
                itemInitOffset += getMessageResult.lastReadOffset;
                continue;
            }
            // build record to return result
            msgMatched = false;
            List<Message> messageList = DataConverterUtil.convertMessage(
                    TServerConstants.OFFSET_HISTORY_NAME, getMessageResult.transferedMessageList);
            for (Message message : messageList) {
                if (message == null) {
                    continue;
                }
                if (!groupName.equals(message.getAttrValue(
                        TServerConstants.TOKEN_OFFSET_GROUP))) {
                    continue;
                }
                msgMatched = true;
                if (msgAccCnt++ == 0) {
                    strBuff.append("{\"groupName\":\"").append(groupName)
                            .append("\",\"result\":true,\"errMsg\":\"ok\",\"records\":[")
                            .append(StringUtils.newStringUtf8(message.getData()));
                } else {
                    strBuff.append(",").append(StringUtils.newStringUtf8(message.getData()));
                }
                if (msgAccCnt >= msgCount) {
                    break;
                }
            }
            if (msgMatched) {
                break;
            }
            itemInitOffset += getMessageResult.lastReadOffset;
        } while (++qryRetryCount < maxRetryCnt);
        // check query result
        if (msgAccCnt > 0) {
            strBuff.append("],\"recordCount\":").append(msgAccCnt).append("}");
        } else {
            // check query result
            if (qryThrow == null) {
                strBuff.append("{\"groupName\":\"").append(groupName)
                        .append("\",\"result\":false,\"errMsg\":\"Could not find record!\"}");
            } else {
                strBuff.append("{\"groupName\":\"").append(groupName)
                        .append("\",\"result\":false,\"errMsg\":\"Get Message failure: ")
                        .append(qryThrow.getMessage()).append("\"}");
            }
        }
    }
Query group's offset records stored in broker.

@param msgStore       history offset store
@param groupName      group name
@param requestOffset  request offset
@param recordStamp    record timestamp
@param msgCount       at most record count
@param maxRetryCnt    max query turns
@param strBuff        string buffer
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/web/BrokerAdminServlet.java