zer0Id0l
zer0Id0l

Reputation: 1444

Kafka consumer Behaviour

I was writing Kafka consumer and I have a query related to consumer processes.

I have a consumer with groupId="testGroupId" and using the same groupId I consume from multiple topics say, "topic1" and "topic2".

Also, assume "topic1" is already created on broker whereas "topic2" is not yet created.

Now If I start the consumer I see consumer threads for "topic1" (which is already created) in zookeeper nodes, but I do not see any consumer thread(s) for "topic2".

My question is, will the consumer thread(s) for "topic2" will be created only after we create the topic on broker?

Upvotes: 1

Views: 120

Answers (1)

codejitsu
codejitsu

Reputation: 3182

I assume you use Kafka ConsumerConnector method like createMessageStreamsByFilter. Consumer will subscribe to kafka topic events and in case of new topics it will subscribe to that topic automatically.

Upvotes: 0

Related Questions