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

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

问题描述

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

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

例如,kafka messags昨天在08:00到09:00之间.

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

推荐答案

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

You can use kafkacat for consuming messages between two timestamps:

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

其中

  • s @ 表示开始时间戳(以毫秒为单位)
  • e @ 表示以ms结尾的timtestamp(非包容性)
  • s@ denotes the starting timestamp in ms
  • e@ denotes the ending timtestamp in ms (non-inclusive)

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

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