Kafka 消息未被消费且偏移量未提交

问题描述 投票:0回答:1

我正在尝试在特定偏移量的主题和特定分区上使用 Kafka 消息。

消费消息的命令如下:

bin/kafka-console-consumer.sh --bootstrap-server (server_ip) --consumer.config file --topic name --partition num --max-messages 1

我还在配置中将自动提交设置为 true。我可以看到消息打印到标准输出,但当前偏移量保持不变。我也尝试过添加组选项,但随后出现错误:

options group and partition cannot be specified together
apache-kafka kafka-consumer-api
1个回答
0
投票

指定分区时,不使用消费者组。它使用消费者的分配 API,而不是订阅。

由于没有组,所以没有可以提交的偏移量

© www.soinside.com 2019 - 2024. All rights reserved.