private ByteBuf buildHBRspPackage(byte[] attrData, byte version, int loadValue) {
        // calculate total length
        int attrsLen = 0;
        if (null != attrData) {
            attrsLen = attrData.length;
        }
        // check load value
        if (loadValue == 0 || loadValue == (-1)) {
            loadValue = 0xffff;
        }
        // binTotalLen = mstType + dataTime + version + bodyLen + body + attrsLen + attrs + magic
        int binTotalLen = 1 + 4 + 1 + 4 + 2 + 2 + attrsLen + 2;
        // allocate buffer and write fields
        ByteBuf binBuffer = ByteBufAllocator.DEFAULT.buffer(4 + binTotalLen);
        binBuffer.writeInt(binTotalLen);
        binBuffer.writeByte(MsgType.MSG_BIN_HEARTBEAT.getValue());
        binBuffer.writeInt((int) (System.currentTimeMillis() / 1000));
        binBuffer.writeByte(version);
        binBuffer.writeInt(2);
        binBuffer.writeShort(loadValue);
        binBuffer.writeShort(attrsLen);
        if (attrsLen > 0) {
            binBuffer.writeBytes(attrData);
        }
        binBuffer.writeShort(0xee01);
        return binBuffer;
    }
Build heartbeat response message ByteBuf

@param attrData  the attribute data
@param version   the version
@param loadValue the node load value
@return ByteBuf
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/source/ServerMessageHandler.java