Marcin
Marcin

Reputation: 454

How to set replication factor in librdkafka?

I'm using librdkafka to develop in C++ kafka message producer.

Is there a way to create topic with custom replication factor, different than default one?

CONFIGURATION.md does not mention explicitly any parameter, but Kafka tools allow for this.

Upvotes: 0

Views: 814

Answers (1)

Edenhill
Edenhill

Reputation: 3113

While auto topic creation is currently supported by librdkafka, it merely uses the broker's topic default configuration.

What you need is manual topic creation from the client. The broker support for this was recently added in KIP-4, which is also supported through librdkafka's Admin API.

See the rd_kafka_CreateTopics() API.

Upvotes: 1

Related Questions