简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM