如何使用 Kafka Console Consumer 在两个时间戳之间使用消息 [英] How to consume messages between two timestamps using Kafka Console Consumer

查看:92
本文介绍了如何使用 Kafka Console Consumer 在两个时间戳之间使用消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Kafka 控制台消费者中检索特定时间戳范围的消息?

Is it possible to retrieve messages in Kafka console conumer for a particular timestamp range?

例如昨天 08:00 到 09:00 之间的 kafka 消息.

For example kafka messags between 08:00 to 09:00 yesterday.

推荐答案

您可以使用 kcat 用于在两个时间戳之间消费消息:

You can use kcat for consuming messages between two timestamps:

kcat -b localhost:9092 -C -t mytopic -o s@1568276612443 -o e@1568276617901

哪里

  • s@ 表示以毫秒为单位的起始时间戳
  • e@ 表示以毫秒为单位的结束时间戳(不包含)
  • s@ denotes the starting timestamp in ms
  • e@ denotes the ending timtestamp in ms (non-inclusive)

这篇关于如何使用 Kafka Console Consumer 在两个时间戳之间使用消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆