# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# see org.apache.kafka.clients.consumer.ConsumerConfig for more details # list of brokers used for bootstrapping knowledge about the rest of the cluster
# format: host1:port1,host2:port2 ...
#bootstrap.servers=localhost:9092 # consumer group id
#group.id=test-consumer-group # What to do when there is no initial offset in Kafka or if the current
# offset does not exist any more on the server: latest, earliest, none
#auto.offset.reset= #zookeeper连接服务器地址
zookeeper.connect=192.168.142.145:2181,192.168.142.146:2181,192.168.142.147:2181 # zookeeper的过期时间,默认5000ms,用于检测消费者是否挂掉
zookeeper.session.timeout.ms=5000 # 当消费者挂掉,其他消费者要等该指定时间才能检查到并且触发重新负载均衡
zookeeper.connection.timeout.ms=10000 # 指定多久消费者更新offset到zookeeper中。注意offset更新时基于time而不是每次获得的消息,一旦在更新zookeeper发生异常并重启,将可能拿到已拿到过的消息。
zookeeper.sync.time.ms=2000 #指定消费组
group.id=xxx_gl_kafka_group #当consumer消费一定量的消息之后,将会自动向zookeeper提交offset信息
#注意offset信息并不是每消费一次消息就向zk提交一次,而是先在本地保存(内存),并定期提交,默认为true
auto.commit.enable=true #自动更新时间。默认60*1000
auto.commit.interval.ms=1000 #当前consumer的标识,可以设定,也可以有系统生成,主要用来跟踪消息消费情况,便于观察
consumer.id=xxx #消费者客户端编号,用于区分不同客户端,默认客户端程序自动产生
client.id=xxxx #最大取多少块缓存到消费者(默认为10)
queued.max.message.chunks=50 当有新的consumer加入group时,将会reblance,此后将会有partition的消费端迁移到新的consumer获得某个partition的消费权限,那么它将会向zk注册"partition owner registry"节点信息,但是有可能此时旧的consumer尚没有释放此节点,此值用于控制,注册节点的重试次数。
rebalance.max.retries=5 #获取信息的最大尺寸,broker不会像consumer输出大于此值的消息chunk,每次fetch将得到很多条消息,此值为总大小,提升此值,将会消耗更多的consumer端内存
fetch.min.bytes=6553600 #当消息的尺寸不足时,server阻塞的时间,如果超时,消息将立即发送给consumer
fetch.wait.max.ms=5000
socket.receive.buffer.bytes=655360 #如果zookeeper没有offset值或者offset值超出范围,那么就给个初始的offset。有smallest、largest、anything可选,分别表示给当前最小的offset、当前最大的offset、抛异常。默认largest
auto.offset.reset=smallest

  

kafka-consumer.properties的更多相关文章

  1. 在kafka/config/目录下面有3个配置文件参数说明(producer.properties。consumer.properties。server.properties)

    (1).producer.properties:生产端的配置文件 #指定kafka节点列表,用于获取metadata,不必全部指定 #需要kafka的服务器地址,来获取每一个topic的分片数等元数据 ...

  2. 【原创】Kafka Consumer多线程实例

    Kafka 0.9版本开始推出了Java版本的consumer,优化了coordinator的设计以及摆脱了对zookeeper的依赖.社区最近也在探讨正式用这套consumer API替换Scala ...

  3. 【原创】Kafka Consumer多线程实例续篇

    在上一篇<Kafka Consumer多线程实例>中我们讨论了KafkaConsumer多线程的两种写法:多KafkaConsumer多线程以及单KafkaConsumer多线程.在第二种 ...

  4. kafka consumer 配置详解

    1.Consumer Group 与 topic 订阅 每个Consumer 进程都会划归到一个逻辑的Consumer Group中,逻辑的订阅者是Consumer Group.所以一条message ...

  5. kafka consumer 0.8.2.1示例代码

    package test_kafka; import java.util.ArrayList; import java.util.HashMap; import java.util.List; imp ...

  6. Kafka Consumer API样例

    Kafka Consumer API样例 1. 自动确认Offset 说明参照:http://blog.csdn.net/xianzhen376/article/details/51167333 Pr ...

  7. 使用kafka consumer api时,中文乱码问题

    使用Intelli idea调试kafka low consumer时,由于broker存储的message有中文, idea中console端是可以正确显示的 然后mvn package打包到服务器 ...

  8. Kafka设计解析(二十)Apache Flink Kafka consumer

    转载自 huxihx,原文链接 Apache Flink Kafka consumer Flink提供了Kafka connector用于消费/生产Apache Kafka topic的数据.Flin ...

  9. 【译】Apache Flink Kafka consumer

    Flink提供了Kafka connector用于消费/生产Apache Kafka topic的数据.Flink的Kafka consumer集成了checkpoint机制以提供精确一次的处理语义. ...

  10. Kafka Consumer接口

    对于kafka的consumer接口,提供两种版本,   high-level 一种high-level版本,比较简单不用关心offset, 会自动的读zookeeper中该Consumer grou ...

随机推荐

  1. 第 11 章 python线程与多线程

    一.什么是线程 在传统操作系统中,每个进程有一个地址空间,而且默认就有一个控制线程. 进程只是用来把资源集中到一起(进程只是一个资源单位,或者说资源集合),而线程才是cpu上的执行单位. 多线程(即多 ...

  2. MongoDB分片配置 优化 不错

    简单注解:mongos 路由进程, 应用程序接入mongos再查询到具体分片,监听端口默认27017config server 路由表服务, 每一台都具有全部chunk的路由信息 shard为数据存储 ...

  3. Python笔记(十三)_os模块和os.path模块

    os模块中关于文件/目录常用的函数使用方法 getcwd() 返回当前工作目录 chdir(path) 改变工作目录 listdir(path='.') 列举指定目录中的文件名('.'表示当前目录,' ...

  4. 【Unity渲染】Camera RenderToCubemap 渲染到立方体纹理

    Unity圣典 传送门:http://www.ceeger.com/Script/Camera/Camera.RenderToCubemap.html Camera.RenderToCubemap 有 ...

  5. 手撸红黑树-Red-Black Tree 入门

    一.学习红黑树前的准备: 熟悉基础数据结构 了解二叉树概念 二.红黑树的规则和规则分析: 根节点是黑色的 所有叶子节点(Null)是黑色的,一般会认定节点下空节点全部为黑色 如果节点为红色,那么子节点 ...

  6. java--反射原理及操作

    1.反射原理 反射具体操作 15.反射的原理(********理解********) * 应用在一些通用性比较高的代码 中 * 后面学到的框架,大多数都是使用反射来实现的 * 在框架开发中,都是基于配 ...

  7. MyBatis中的$和#,用不好,准备走人!

    作者:程序猿的内心独白 https://m.toutiaocdn.com/i6685496024770806280 这是一次代码优化过程中发现的问题,在功能优化后发现部分数据查不到出来了,问题就在于一 ...

  8. 二叉树BinTree类定义

    #include<iostream> using namespace std; template<class T> struct BinTreeNode{//二叉树结点类 T ...

  9. Python : Polymorphism

    class Animal: def __init__(self, name): # Constructor of the class self.name = name def talk(self): ...

  10. bzoj3218 a + b Problem(网络流+主席树)

    $ans=\sum_{color_i=black}\ b_i+\sum_{color_i=white}\ w_i-\sum_{i=abnormal}\ p_i$ 把它转化一下 $ans=\sum_{i ...