consumer属性
-
group.id:指定consumer group的唯一标识。
-
consumer.id:唯一标识consumer。默认值为null,不指定时会自动生成。
-
zookeeper.connect:指定ZooKeeper的连接字符串,格式为<hostname:port/chroot/path>。/chroot/path为全局ZooKeeper命名空间内的数据位置。
-
client.id:标识发起请求的客户端。默认值为${group.id}。
-
zookeeper.session.timeout.ms:指定一个时间(毫秒)用于consumer等待ZooKeeper声明失效或重新均衡。默认值为6000。
-
zookeeper.connection.timeout.ms:指定客户端建立ZooKeeper连接的最大等待时间(毫秒)。默认值为6000。
-
zookeeper.sync.time.ms:指定ZooKeeper follower同步leader的时间(毫秒)。默认值为2000。
-
auto.commit.enable:该属性为true时,已经被consumer获取的消息offset会被阶段性提交ZooKeeper中。在consumer失效时新consumer将以提交的offset作为起始位置。默认值为true。
-
auto.commit.interval.ms:指定已被消费的offset提交到ZooKeeper的频率(毫秒)。默认值为60*1000。
-
auto.offset.reset:指定offset值,如果ZooKeeper中有初始offset或者offset超出范围。可选值有:largest重新设置为最大的offset;smallest重新设置为最小的offset;其他任意值抛出异常。默认值为largest。
-
consumer.timeout.ms:在指定的消息间隔后没有可被消费的消息时向consumer抛出一个异常。默认值为-1。
-
相关文章:
-
2021-07-13
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-07-22
-
2021-05-16
-
2021-09-06
-
2022-02-01
猜你喜欢
-
2021-12-10
-
2021-06-09
-
2022-02-01
-
2021-07-05
-
2021-06-18
相关资源
-
下载
2021-06-06
-
下载
2023-01-09
-
下载
2022-12-31