概念

consumer 向 broker 发送心跳,表明自己还活着,不用被踢出消费者组

参数

session.timeout.ms
表示 consumer 向 broker 发送心跳的超时时间。例如 session.timeout.ms = 180000 表示在最长 180 秒内 broker 没收到 consumer 的心跳,那么 broker 就认为该 consumer 死亡了,会启动 rebalance。

The timeout used to detect worker failures. The worker sends periodic heartbeats to indicate its liveness to the broker. If no heartbeats are received by the broker before the expiration of this session timeout, then the broker will remove the worker from the group and initiate a rebalance. Note that the value must be in the allowable range as configured in the broker configuration by group.min.session.timeout.ms and group.max.session.timeout.ms.

默认值10s

heartbeat.interval.ms
表示 consumer 每次向 broker 发送心跳的时间间隔。heartbeat.interval.ms = 60000 表示 consumer 每 60 秒向 broker 发送一次心跳。一般来说,session.timeout.ms 的值是 heartbeat.interval.ms 值的 3 倍以上。

The expected time between heartbeats to the consumer coordinator when using Kafka’s group management facilities. Heartbeats are used to ensure that the consumer’s session stays active and to facilitate rebalancing when new consumers join or leave the group. The value must be set lower than session.timeout.ms, but typically should be set no higher than 1/3 of that value. It can be adjusted even lower to control the expected time for normal rebalances

总结

  • 为防止错误reblance,这两个参数可以稍微设大点

kafka 心跳参数相关推荐

  1. 6张图阐述Kafka心跳机制(时间轮算法的具体运用)

    Broker端与客户端的心跳在Kafka中非常的重要,因为一旦在一个心跳过期周期内(默认10s),Broker端的消费组组协调器(GroupCoordinator)会把消费者从消费组中移除,从而触发重 ...

  2. Kafka关键参数设置

    生产环境中使用Kafka,参数调优非常重要,而Kafka参数众多,我们的java的Configuration代码中,经常设置的参数如下: Properties props = new Properti ...

  3. Kafka 心跳机制 重复消费

    kafka 心跳机制 Kafka是通过心跳机制来控制消费超时,心跳机制对于消费者客户端来说是无感的,它是一个异步线程,当我们启动一个消费者实例时,心跳线程就开始工作了.心跳超时会导致消息重复消费. 在 ...

  4. Kafka一些参数配置

    Producer消息发送 producer.send(msg); // 用类似这样的方式去发送消息,就会把消息给你均匀的分布到各个分区上去 producer.send(key, msg); // 订单 ...

  5. kafka 中参数:session.timeout.ms 和 heartbeat.interval.ms的区别

    文章目录 1.heartbeat.interval.ms 2.heartbeat.interval.ms 与 session.timeout.ms 的对比 3.session.timeout.ms 和 ...

  6. kafka config参数配置简要说明

    #kafka参数配置 #等待所有的replicas都响应后才返回响应,可靠性最高,但会降低吞吐率 acks=all #发生Retriable exceptions可重试异常时,重试发送消息次数,最大为 ...

  7. kafka消费者参数解析

    官方文档(http://kafka.apache.org/documentation/#consumerconfigs): 参数名 含义 默认值 heartbeat.interval.ms The e ...

  8. kafka 心跳和 reblance

    kafka 的心跳是 kafka consumer 和 broker 之间的健康检查,只有当 broker coordinator 正常时,consumer 才会发送心跳. consumer 和 re ...

  9. kafka消费者参数详解 java读取不到消费者数据

    程序运行中,生产者可以成功生产数据,消费者却一直拿不到存储的数据,运行消费者命令:kafka-console-consumer --bootstrap-server 127.0.0.1:9092 -- ...

最新文章

  1. 【Java】类与对象 - 参数传值
  2. visualVM 安装使用
  3. 算法设计:双相机高斯建模算法优化
  4. Matlab R2016a 如何设置自己称心的工作区域
  5. 嵌入式闪存您了解多少?听听专家怎么说!
  6. Pandas数据可视化工具:图表工具-Seaborn
  7. 时序图如何表现分支_【Video Recognition】在视频分类任务中如何高效使用3D卷积...
  8. 双马尾机器人(???)
  9. Pycharm在创建py文件时, 如何自动添加文件头注释?
  10. 《程序是怎样跑起来的》七
  11. 最值得收藏的几种文档对比、文本对比、代码对比、文件对比的工具
  12. 有没有那种免费的办公软件?
  13. 电信光猫DDNS的设置经历
  14. [书籍阅读] Spring Persistence with Hibernate
  15. 100%代码覆盖率的悲剧
  16. SAP中 关于BAPI_MATERIAL_SAVEDATA创建物料报错:字段MARA-MEINS/BAPI_MARA-BASE_UOM(_ISO)被定义为必需的字段; 它不包含条目
  17. 家庭光纤宽带延长光纤
  18. 镭速传输:TB级大文件传输,一招教你搞定
  19. 如何批量压缩pdf文件到最小
  20. Hive数据仓库数据分析

热门文章

  1. 如何添加行号 c语言,如何为程序代码加上行号
  2. 接收二进制数据_漫话TCP/IP:数据链路层-以太网(1)
  3. idea Spring-boot 项目debug启动过慢 spring debug启动过慢解决办法:已解决
  4. GAN用数学语言描述
  5. Android Studio实现前后台分离的选课系统
  6. eclipse查看jar包源码(反编译)
  7. java 向下转型运行时错误_java多态和向下转型问题。
  8. astar插件下载 就行_送给你们一个ps插件,5秒抠图神器,这个肯定是你找了很久的...
  9. 在html中使用css的主要方式有,html中使用css的方法有哪几种
  10. 旋转区域_高空旋转雾化机雾桩应用场所、高压喷雾立杆式降尘设备,高压微雾除尘系统原理以及优势...