栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Kafka 一些异常报错、注意事项(1)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Kafka 一些异常报错、注意事项(1)

记录一:This member will leave the group because consumer poll timeout has expired.

[| test_kafka_group] o.a.k.c.c.internals.AbstractCoordinator : [Consumer clientId=consumer-2, groupId=test_kafka_group] This member will leave the group because consumer poll timeout has expired. This means the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time processing messages. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records.

原因:对kafka的max_poll_records 设置过大,处理不过来。

记录二:kafka写入异常 magic v1 does not supprt record headers

原因:0.10的kafka服务端是不支持header的,用高版本的kafka客户端0.11不报错。用了skywalking,不能用kafka的0.11以下版本,需要升级。

记录三:kafka分区

主题分区数。kafka通过分区策略,将不同的分区分配在一个集群中的broker上,一般会分散在不同的broker上,当只有一个broker时,所有的分区就只分配到该Broker上。

min-partition-count: 3 #定义最小分区个数
replication-factor: 3 # 用来设置主题的副本数
spring.cloud.stream.bindings.testa.consumer.concurrency=2 #设置消费线程数
spring.cloud.stream.bindings.testa.consumer.partitioned=true #消费者设置分区
# 属于consumer的配置项,出现在0.10及其以上版本中;一次调用poll()操作时返回的最大记录数,默认值为500
spring.kafka.consumer.max-poll-records: 500

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/843117.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号