[Warning] [82] The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id. #92
你遇到了什么问题?
[82] The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id.
[82] The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id. 告警具体堆栈如下:
[WARNING] longlang\phpkafka\Exception\KafkaErrorException: [82] The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id. in /data/project/vendor/longlang/phpkafka/src/Protocol/ErrorCode.php:385
Stack trace:
#0 /data/project/vendor/longlang/phpkafka/src/Util/KafkaUtil.php(84): longlang\phpkafka\Protocol\ErrorCode::check()
#1 /data/project/vendor/longlang/phpkafka/src/Group/GroupManager.php(123): longlang\phpkafka\Util\KafkaUtil::retry()
#2 /data/project/vendor/longlang/phpkafka/src/Consumer/Consumer.php(402): longlang\phpkafka\Group\GroupManager->heartbeat()
#3 /data/project/vendor/longlang/phpkafka/src/Consumer/Consumer.php(419): longlang\phpkafka\Consumer\Consumer->heartbeat()
#4 /data/project/vendor/longlang/phpkafka/src/Consumer/Consumer.php(294): longlang\phpkafka\Consumer\Consumer->checkBeartbeat()
#5 /data/project/vendor/longlang/phpkafka/src/Consumer/Consumer.php(248): longlang\phpkafka\Consumer\Consumer->fetchMessages()
#6 /data/project/vendor/longlang/phpkafka/src/Consumer/Consumer.php(224): longlang\phpkafka\Consumer\Consumer->consume()
#7 /data/project/vendor/hyperf/kafka/src/ConsumerManager.php(146): longlang\phpkafka\Consumer\Consumer->start()
#8 /data/project/vendor/hyperf/process/src/AbstractProcess.php(99): Hyperf\Process\AbstractProcess@anonymous->handle()
#9 [internal function]: Hyperf\Process\AbstractProcess->Hyperf\Process\{closure}()
#10 {main}
你遇到了什么问题?
[82] The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id.
Kafka 环境是自建还是云服务? Aws Kafka(MSK)
请执行下面的命令获取环境信息。
config/kafka.php
这里的
KAFKA_BROKERS
连接了 3 个kafka
地址(host1:port1,host2:port2,host3:port3
)。[82] The broker rejected this static consumer since another consumer with the same group.instance.id has registered with a different member.id.
告警具体堆栈如下:原因大概应该(?)是同一个消费者启动多个进程后会触发
[27] REBALANCE_IN_PROGRESS
,然后在代码中会启动心跳检测,在触发心跳检测时发起的请求参数中member.id
发生了变动(请求心跳的member.id
与发起socket
的member.id
不一致),导致kafka
返回了该错误。日志
以下为
longlang\phpkafka\Protocol\SyncGroup\SyncGroupRequest.php
在longlang\phpkafka\Util\KafkaUtil.php
中retry
方法的输出结果:比如以下三条的
member.id
是明显对不上了: