简体   繁体   English

如何在librdkafka中设置复制因子?

[英]How to set replication factor in librdkafka?

I'm using librdkafka to develop in C++ kafka message producer. 我正在使用librdkafka在C ++ kafka消息生成器中进行开发。

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. CONFIGURATION.md没有明确提及任何参数,但是Kafka工具允许这样做。

While auto topic creation is currently supported by librdkafka, it merely uses the broker's topic default configuration. 尽管librdkafka当前支持自动主题创建,但它仅使用代理的主题默认配置。

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. 最近在KIP-4中添加了对此的代理支持,librdkafka的Admin API也支持该支持。

See the rd_kafka_CreateTopics() API . 请参阅rd_kafka_CreateTopics() API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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