目录
1、指定某个group的offset到某个时间点
kafka-consumer-groups.sh \
--bootstrap-server 127.0.0.1:9092 \
--group group_test \
--topic test_topic \
--reset-offsets \
--to-datetime 2022-07-02T12:00:00.000 \
-execute
2、通过该group进行消费
kafka-console-consumer.sh \
-topic test_topic \
--bootstrap-server 127.0.0.1:9092 \
--group group_test
3、打印其他属性
--property print.offset=true \
--property print.partition=true \
--property print.headers=true \
--property print.timestamp=true \
--property print.key=true
4、指定序列化与反序列化方式
--key-deserializer "org.apache.kafka.common.serialization.LongDeserializer" \
--value-deserializer "org.apache.kafka.common.serialization.DoubleDeserializer"
5、自定义格式
--formatter my.custom.KafkaMetricsFormatter