所以当我寻找一种方法来计算一个主题中的消息时,这个很好
kafka-run-class kafka.tools.GetOffsetShell --broker-list broker1:9092,broker2:9092,broker3:9092 --topic rev-dly-upd --time -1
唯一的事情是,当我将retention.ms
配置更改为时retention.ms=1000
,甚至通过运行检查主题是否已配置kafka-topics --describe --zookeeper zookeeper1:2181 --topic rev-dly-upd
。我可以清楚地看到该配置设置为1000 ...
Topic:rev-dly-upd PartitionCount:8 ReplicationFactor:3 Configs:retention.ms=1000
Topic: rev-dly-upd Partition: 0 Leader: 159 Replicas: 159,96,160 Isr: 159,96,160
Topic: rev-dly-upd Partition: 1 Leader: 160 Replicas: 160,159,94 Isr: 94,160,159
Topic: rev-dly-upd Partition: 2 Leader: 94 Replicas: 94,160,95 Isr: 95,94,160
Topic: rev-dly-upd Partition: 3 Leader: 95 Replicas: 95,94,96 Isr: 95,96,94
Topic: rev-dly-upd Partition: 4 Leader: 96 Replicas: 96,95,159 Isr: 95,96,159
Topic: rev-dly-upd Partition: 5 Leader: 159 Replicas: 159,160,94 Isr: 159,94,160
Topic: rev-dly-upd Partition: 6 Leader: 160 Replicas: 160,94,95 Isr: 94,160,95
Topic: rev-dly-upd Partition: 7 Leader: 94 Replicas: 94,95,96 Isr: 95,96,94
然而,当我运行 kafka-run-class kafka.tools.GetOffsetShell --broker-list broker1:9092,broker2:9092,broker3:9092 --topic rev-dly-upd --time -1
all 时,我总是会返回记录。可能是什么原因?