1

when consume message from kafka,usually with a group id.But,SimpleConsumer API just use a clientName.The clientName is group id?

4

1 回答 1

3

In case of SimpleConsumer, clientName is just an identifier for the client. It is not group id. In fact there is no concept of consumer groups in SimpleConsumer.

Please refer to documentation - The main reason to use a SimpleConsumer implementation is you want greater control over partition consumption than Consumer Groups give you.

High Level Consumer has the concept of consumer groups.

The ‘group.id’ string defines the Consumer Group this process is consuming on behalf of.

Consumer Group is a high level concept in which a particular message is consumed by only one of the consumers which belong to the same group

于 2015-04-30T03:58:26.773 回答