【服务器篇笔记02-kafka】

接上篇写到:

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

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

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

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

原来的数据:

已加载 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,在依次过期的时候,日志文件是如何变化的

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值