hangyuan
hangyuan

Reputation: 182

kafka partition assignment on 'consumers'

I understand that kafka arranges data of a topic over many partitions, and consumers in one consumer group are assigned different partitions from where they can receive data:

 partition-1  partition-2  partition-3  partition-4  partition-5  partition-6
      |____________|            |____________|           |____________|
            |                         |                        |
       consumer-1                 consumer-2               consumer-3

My question is:

In other words, if I start two threads or processes, running the same kafka client code with same consumer group, are they considered one consumer or two consumers?

Upvotes: 0

Views: 233

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191733

First, Consumers are not thread safe.

More than one instance in separate threads / processes would not be considered as the same client in the group, but they do display host information when you describe the consumer group

Upvotes: 0

Related Questions