为了账号安全,请及时绑定邮箱和手机立即绑定

Chronicle Consumer 没有正确读取记录?

Chronicle Consumer 没有正确读取记录?

动漫人物 2021-09-12 20:29:51
我正在使用编年史队列(5.16.13)将 json 值写入和读取到编年史文件。要编写对象,我在循环中使用以下内容try (final DocumentContext dc = appender.writingDocument()) {        dc.wire().write(() -> "msg").text("Hallo asdf");        System.out.println("your data was store to index="+ dc.index());        return true;    } catch (Exception e) {        logger.warn("Unable to store value to chronicle", e);        return false;    }并阅读项目我在循环中执行以下调用DocumentContext documentContext;    do {        documentContext = tailer.readingDocument();        currentOffset = documentContext.index();        System.out.println("Current offset: " + currentOffset);    } while (!documentContext.isData());我观察到的是变量currentOffset没有改变,一段时间后(似乎取决于有效载荷大小)循环无限大,当前偏移量具有疯狂的值。第一个循环的输出(缩短)是Writing 0your data was store to index=76385993359360Writing 1your data was store to index=76385993359361Writing 2your data was store to index=76385993359362Writing 3your data was store to index=76385993359363Writing 4your data was store to index=76385993359364Writing 5your data was store to index=76385993359365Writing 6your data was store to index=76385993359366Writing 7your data was store to index=76385993359367Writing 8your data was store to index=76385993359368Writing 9your data was store to index=76385993359369Writing 10your data was store to index=76385993359370Writing 11
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 139 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信