Lazaruss
Lazaruss

Reputation: 1237

KafkaConsumer position(TopicPartition) never ends

I am trying to use KafkaConsumer to get the current position on partition with id 0.

consumer.position(new TopicPartition("my-topic-name", 0))

However, this never returns. It keeps trying to send these two requests :

and it just keeps repeating them over and over. I get one error in between these two requests :

Number of alive brokers '1' does not meet the required replication factor '3' for the offsets topic

So it keeps repeating these steps

and it doesn't stop

But this makes no sense since my topic is started with a replication factor of 1. I have only one kafka instance running on my localhost. And since number of brokers is 1, replication factor must also be 1, right ?

Please, help.

Upvotes: 0

Views: 308

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191864

since number of brokers is 1, replication factor must also be 1, right ?

Yes, but there are separate configurations for the internal topics

Based on the error about the "offsets topic", look for offsets.topic.replication.factor in your server.properties

Upvotes: 1

Related Questions