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

问题描述

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 信息oakcciAbstractCoordinator [pool-5-thread-1] (重新)加入组image-consumer-group

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信息o.a.k.c.c.i.AbstractCoordinator [pool-5-thread-1]将组图像消费者组的协调器标记为死

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]发现了组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 信息oakcciAbstractCoordinator [pool-5-thread-1] (重新)加入组image-consumer-group

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:18