天天看點

kafka添加消息寫入partition時間戳的方法

1、修改kafka的屬性:

kafka-topics --alter --topic topicname --zookeeper localhost:2181/kafka --config message.timestamp.type=LogAppendTime

2、在消費者指令行工具中列印LogAppendTime:

kafka-console-consumer --bootstap-server localhost:9092 --topic topicname --property print.timestamp=true --partition 17 --offset 12345