gpt4 book ai didi

apache-kafka - 从 KStream 开始阅读 Kafka 主题

转载 作者:行者123 更新时间:2023-12-01 23:38:00 26 4
gpt4 key购买 nike

我的 spring boot 项目有一个演示 Kafka Streams API 的应用程序。我能够使用主题 customer 中的所有消息使用命令
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic customer --from-beginning
Kafka Streams API 中使用 KStream 或 KTable 消费消息的类似命令是什么?我试过
properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"earliest");
properties.put("auto.offset.reset", "earliest");

两者都不起作用。我确实创建了一个测试用例来使用 KafkaConsumer而不是 Streams,它没有用。代码上传到Github以供引用。任何帮助都会很棒。

最佳答案

工具bin/kafka-streams-application-reset.sh允许从 v1.1 开始查找。

参见https://cwiki.apache.org/confluence/display/KAFKA/KIP-171+-+Extend+Consumer+Group+Reset+Offset+for+Stream+Application

关于apache-kafka - 从 KStream 开始阅读 Kafka 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49833308/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com