本文介绍了卡夫卡消费者卡在(重新)加入组中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果 kafka(版本 0.10)消费者尝试重新加入消费者组,它的默认行为是什么.我正在为一个消费者组使用单个消费者,但似乎重新加入时受到了打击.每 10 分钟后,它会在消费者日志中打印以下行.

Whats the default behavior of kafka (version 0.10) consumer if it tries to rejoin the consumer group.I am using a single consumer for a consumer group but it seems like it got struck at rejoining. After each 10 min it print following line in consumer logs.

2016-08-11 13:54:53,803 INFO o.a.k.c.c.i.ConsumerCoordinator [pool-5-thread-1] ****撤销先前分配的分区**** [] 组 image-consumer-group

2016-08-11 13:54:53,803 INFO OakcciAbstractCoordinator [pool-5-thread-1] (重新)加入图像消费者组

2016-08-11 13:54:53,803 INFO o.a.k.c.c.i.AbstractCoordinator [pool-5-thread-1] (Re-)joining group image-consumer-group

2016-08-11 14:04:53,992 INFO o.a.k.c.c.i.AbstractCoordinator [pool-5-thread-1] 将协调器标记为 group image-consumer-group 死亡

2016-08-11 14:04:53,992 INFO o.a.k.c.c.i.AbstractCoordinator [pool-5-thread-1] Marking the coordinator dead for group image-consumer-group

2016-08-11 14:04:54,095 INFO o.a.k.c.c.i.AbstractCoordinator [pool-5-thread-1] 发现了 group image-consumer-group 的协调器.

2016-08-11 14:04:54,095 INFO o.a.k.c.c.i.AbstractCoordinator [pool-5-thread-1] Discovered coordinator for group image-consumer-group.

2016-08-11 14:04:54,096 INFO OakcciAbstractCoordinator [pool-5-thread-1] (重新)加入图像消费者组

2016-08-11 14:04:54,096 INFO o.a.k.c.c.i.AbstractCoordinator [pool-5-thread-1] (Re-)joining group image-consumer-group

重新启动消费者应用程序无济于事.

Restart consumer application is not helping.

推荐答案

如果你打算在一个组中只有一个消费者实例,那么使用手动 assignment 策略的消费者.(简单消费者).

If you're gonna to have only one consumer instance in a group, then use the consumer with manual assignment strategy. (Simple Consumer).

手动主题分配不使用消费者的组管理功能,因此不需要心跳.

Manual topic assignment does not use the consumer's group management functionality so heart beats are not required.

这篇关于卡夫卡消费者卡在(重新)加入组中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 20:19