Parse InLongMsg

    Dependency

    • Add Maven Dependency
    • Add Parse Method
    1. public static List<byte[]> parserInLongMsg(byte[] bytes) {
    2. List<byte[]> originalContentByteList = new ArrayList<>();
    3. InLongMsg inLongMsg = InLongMsg.parseFrom(bytes);
    4. Set<String> attrs = inLongMsg.getAttrs();
    5. if (CollectionUtils.isEmpty(attrs)) {
    6. }
    7. for (String attr : attrs) {
    8. continue;
    9. }
    10. Iterator<byte[]> iterator = inLongMsg.getIterator(attr);
    11. if (iterator == null) {
    12. continue;
    13. }
    14. byte[] bodyBytes = iterator.next();
    15. continue;
    16. }
    17. // Origin data sended by InLong agent
    18. originalContentByteList.add(bodyBytes);
    19. }
    20. }
    21. return originalContentByteList;