如何使用Kafka Console Consumer在两个时间戳之间使用消息

编程入门 行业动态 更新时间:2024-10-10 19:23:17
本文介绍了如何使用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在两个时间戳之间使用消息

本文发布于:2023-11-22 01:19:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1615413.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   两个   消息   时间   Consumer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!