接上篇写到:

就是说从offset为37的时候开始消费就能取到消费信息,也就是37是一个节点,区分过期前和过期后的一个节点。对应的几个日志文件的名字也体现了这点。猜想下,到了一个过期时间的到来,日志文件的名字会再次改变生成新的,对应的数字也是offset的区别过期前与后的。

但是我还是发现一疑问,就是我下午两点零几分设置的过期,到三点零几分算是过期了。后来我查询消费信息,是将近五点了

【服务器篇笔记02-kafka】

后面的数据是我新通过mqtt客户端发布的,上一篇博客也差不多是这个时间

【服务器篇笔记02-kafka】

然后六点十多分的时候我,查看,是生成新的,大小为0的文件

【服务器篇笔记02-kafka】

原来的数据:

已加载 kafka_client
连接成功 ---2019-03-28 16:58:09
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553787263}',
  offset: 37,
  partition: 0,
  highWaterOffset: 39,
  key: null }
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553788203}',
  offset: 38,
  partition: 0,
  highWaterOffset: 39,
  key: null }
尚丰灯光socket listening on 15941
The port【3000】 is available.
若琪智能音箱协议: http://localhost:3000
  list: http://localhost:3000/v1/list/
  execute: http://localhost:3000/v1/list/
纳海协议 listening on 8080
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553791608}',
  offset: 39,
  partition: 0,
  highWaterOffset: 40,
  key: null }
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553791611}',
  offset: 40,
  partition: 0,
  highWaterOffset: 41,
  key: null }
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553791612}',
  offset: 41,
  partition: 0,
  highWaterOffset: 42,
  key: null }
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553791612}',
  offset: 42,
  partition: 0,
  highWaterOffset: 43,
  key: null }
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553791613}',
  offset: 43,
  partition: 0,
  highWaterOffset: 44,
  key: null }
{ topic: 'Processing',
  value: '{"action":"message_publish","device_id":"1103262d-ff94-4609-b578-8018721e740c1553647524324","username":"mosl","topic":"/mosl","payload":"我是莫世林 hello hello hello 201903281353","ts":1553791614}',
  offset: 44,
  partition: 0,
  highWaterOffset: 45,
  key: null }

正好offset是到44的,说明和我的猜想几乎一致,就是不知道如果建立不同时间段的log,在依次过期的时候,日志文件是如何变化的

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2021-07-17
  • 2021-11-23
  • 2022-01-06
  • 2021-09-11
  • 2022-12-23
猜你喜欢
  • 2021-04-14
  • 2021-05-09
  • 2021-05-31
  • 2021-11-23
  • 2021-08-02
  • 2022-01-17
  • 2022-01-30
相关资源
相似解决方案