Home > other > In kafka can specify multiple consumer in a project
In kafka can specify multiple consumer in a project
Time:09-19
Or start the only set of processes for consumer, under the condition of the same consumer groups, multiple consumer can be in the process of a startup?
How to configure the need to develop the time?
CodePudding user response:
Certainly, just under the same consumer groups each consumer is a competitive relationship, can promote consumption performance,
CodePudding user response:
First of all, your topic must be multiple partitions, a partition, a consumer group ID (consumerGroupId) will only have a consumer instance to consumption data, Topic1 has two partitions, for example, cgi1 have 3 consumers, only one of two consumers to buy their topic1 partitions, remaining 1 get less than consumer rights, there is no data to vomit to him, Hang up when one of the consumers or processing delay more than configuration threshold value, the consumer will be the broker as a hang up, recover the consumer rights, free of the substituted for the hang up of consumers, from the last submitted offset began to hang up consumer spending again, About the mechanism, to search [kafka isr] In Sync - up mechanism, copy, whether consumers or partitions are follow this mechanism, it is one of the most core knowledge kafka,
CodePudding user response:
So we have the most robust approach is n partition instance n + x consumers to spend, and then through the related business mechanism, control for hang up, substitute caused by repeated consumption, reduce the side effects,