morganstanley / modern-cpp-kafka

A C++ API for Kafka clients (i.e. KafkaProducer, KafkaConsumer, AdminClient)
Apache License 2.0
331 stars 86 forks source link

publishing message to multiple brokers? #224

Closed seanngpack closed 9 months ago

seanngpack commented 9 months ago

Is there any additional setup to publishing a message to multiple brokers? My setup only publishes to the first broker in the brokers string.

The producer initializes correctly with the list of brokers: [2023-09-14 09:00:17.341860]NOTICE KafkaProducer[a5b6052c-3e85cf6b] initializes with properties[bootstrap.servers=some_ip:9092,some_ip2:9092|client.id=a5b6052c-3e85cf6b|enable.idempotence=true|log_level=5]

const std::string brokers = "some_ip:9092,some_ip2:9092" // NOLINT
const Topic topic = "some_topic";            // NOLINT

and I send the message just like the producer example:

producer.send(record, deliveryCb, KafkaProducer::SendOption::ToCopyRecordValue);

would appreciate any thoughts or how to debug! thanks

seanngpack commented 9 months ago

oh, it seems like it's because my brokers are located on different Kafka clusters. will verify later, but im pretty sure this is this issue