`
bit1129
  • 浏览: 1051640 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

【Kafka十四】关于auto.offset.reset[Q/A]

 
阅读更多
I got serveral questions about auto.offset.reset. This configuration parameter governs how  consumer read the message from Kafka when there is no initial offset in ZooKeeper or if an offset is out of range. 
Q1. "no initial offset in zookeeper "  means that there isn't any consumer to consume the message yet(The offset is set once the consumer starts to consume)?
--Yes, or if you consumed messages, but auto offset commit is disabled and you haven't explicitly committed any offsets.
Q2:  What does "offset is out of range" mean? Can you eleborate one scenario when "offset is out of range" could happen?
Kafka uses a retention policy for topics to expire data and clean it up. If some messages expire and your consumer hasn't run in a while, the last committed offset may no longer exist
 
auto.offset.reset has two values:smallest and largest.
Assume one scenario: A producer has produced 10 messages to kafka, and there is no consumer yet to consume it.
Q3: If auto.offset.reset is set to "smallest", does it mean that the consumer will read the message from the offset 0?(0 is smallest here)
YES
Q4: If auto.offset.reset is set to "largest", does it mean that the consumer will not read any message but wait until new messages come?
Also correct. This is why in the quickstart you need to use the --from-beginning flag on the console consumer. Since the consumer is executed after the console producer it wouldn't see any messages unless it set auto.offset.reset to smallest, which is what --from-beginning does.
 
分享到:
评论

相关推荐

    kafka-manager-1.3.3.22.zip

    已编译 Kafka-Manager-1.3.3.22 linux下直接解压解压kafka-manager-1.3.3.22.zip到/opt/module目录 [root@hadoop102 module]$ unzip kafka-manager-1.3.3.22.zip 4)进入到/opt/module/kafka-manager-1.3.3.22/...

    kafka_2.9.2-0.8.2.1.tgz

    bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --zkconnect localhost:2181 --group test 删除topic与数据 1) kafka-topics.sh --delete --zookeeper host:port --topic topicname 2) 删除kafka...

    下载慢?给你Kafka 2.xx所有版本下载的百度网盘链接

    kafka_2.11-2.0.0.tgz, kafka_2.11-2.0.1.tgz, kafka_2.11-2.1.0.tgz, kafka_2.11-2.1.1.tgz, kafka_2.11-2.2.0.tgz, kafka_2.11-2.2.1.tgz, kafka_2.11-2.2.2.tgz, kafka_2.11-2.3.0.tgz, kafka_2.11-2.3.1.tgz, ...

    kafka-clients-0.10.0.1-API文档-中文版.zip

    赠送jar包:kafka-clients-0.10.0.1.jar; 赠送原API文档:kafka-clients-0.10.0.1-javadoc.jar; 赠送源代码:kafka-clients-0.10.0.1-sources.jar; 赠送Maven依赖信息文件:kafka-clients-0.10.0.1.pom; 包含...

    kafka-manager1.3.3.7已编译.zip

    unzip kafka-manager-1.3.3.7.zip -d /data/ cd /data/kafka-manager-1.3.3.7 [root@kafka50 conf]# pwd /data/kafka-manager-1.3.3.7/conf [root@kafka50 conf]# ls application.conf consumer.properties ...

    kafka-2.10-0.8.1.1

    kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1kafka_2.10-0.8.1.1...

    kafka_2.13-2.8.1.rar 安装包。 支持大字符串生产和消费(已修改过配置)

    kafka_2.13-2.8.1.rar 安装包。 支持大字符串生产和消费(已修改过配置) 0 解压 进入bin目录 1.先启动zk ./zookeeper-server-start.sh ../config/zookeeper...../kafka-server-start.sh ../config/server.properties

    kafka-manager-2.0.0.2.zip

    kafka-manager.jar 配置application.conf中的zk地址后可直接启动 bin/kafka-manager -Dconfig.file=/kafka-manager-2.0.0.2/conf/application.conf -Dhttp.port=8888

    kafka-manager 1.3.3.15

    已经编译好的 kafka-manager 1.3.3.15 具体使用可以参考 https://github.com/yahoo/kafka-manager

    kafka_2.10-0.8.2.1.tgz

    kafka_2.10-0.8.2.1.tgz安装包,如果需要请下载

    最新版kafka kafka_2.13-2.6.0.tgz

    最新版kafka kafka_2.13-2.6.0.tgz

    KAFKA-3.1.1-1.3.1.1.p0.2-el7.parcel

    KAFKA-3.1.1-1.3.1.1.p0.2-el7

    kafka_2.11-0.9.0.1.tgz

    kafka_2.11-0.9.0.1.tgz 亲测可用 Kafka是由Apache软件基金会开发的一个开源流处理平台,由Scala和Java编写。Kafka是一种高吞吐量的分布式发布订阅消息系统,它可以处理消费者在网站中的所有动作流数据。 这种动作...

    kafka_2.11-0.10.2.0.tar.gz

    kafka_2.11-0.10.2.0 版解压使用 kafka kafka kafka kafka kafka

    KAFKA-3.0.0-1.3.0.0.p0.40-el7

    KAFKA-3.0.0-1.3.0.0.p0.40-el7.parcel KAFKA-3.0.0-1.3.0.0.p0.40-el7.parcel.sha1 manifest.json

    org.apache.kafka kafka_2.10 0.10.2.0 的jar包下载

    依赖方式 ... <groupId>org.apache.kafka</groupId>  <artifactId>kafka_2.10</artifactId>  <version>0.10.0.0</version> </dependency> 但是没有被中央仓库的任何jar包依赖!您可以在这里点击下载

    kafka-manager-1.3.3.7.zip

    说明:kafka-manager 自己下载编译速度巨慢,此资源是编译好的 kafka-manager,版本是:kafka-manager-1.3.3.7(适用于较新的版本,kafka版本是kafka_2.11-2.0.1)。 安装配置说明: 1. 里头有个自己写的启动脚本,...

    kafka_2.11-0.10.1.0.tgz

    kafka_2.11-0.10.1.0.tgzKafka是一种高吞吐量的分布式发布订阅消息系统,它可以处理消费者规模的网站中的所有动作流数据。 这种动作(网页浏览,搜索和其他用户的行动)是在现代网络上的许多社会功能的一个关键因素...

    kafka-manager-1.3.0.8.zip

    此代码是已经编译好的kafaka的管理端,下载...3、启动,nohup ./kafka-manager -Dconfig.file=../conf/application.conf -Dhttp.port=9001 >/dev/null 2>&1 & 4、在地址栏输入对应的ip:9001即可进入kafka-manager界面。

    kafka-clients-0.9.0.0-API文档-中英对照版.zip

    赠送jar包:kafka-clients-0.9.0.0.jar; 赠送原API文档:kafka-clients-0.9.0.0-javadoc.jar; 赠送源代码:kafka-clients-0.9.0.0-sources.jar; 赠送Maven依赖信息文件:kafka-clients-0.9.0.0.pom; 包含翻译后...

Global site tag (gtag.js) - Google Analytics