mfontanini / cppkafka

Modern C++ Apache Kafka client library (wrapper for librdkafka)
BSD 2-Clause "Simplified" License
587 stars 207 forks source link

CPPKafka crashes when trying to create a configuration in Windows #310

Open ksohan opened 1 year ago

ksohan commented 1 year ago

I have built the CPPKafka using vcpkg and when I tried the following simple code, it is crashing while trying to create the configuration.

Configuration config = {
    { "metadata.broker.list", "127.0.0.1:9092" }
};
std::cout << "Hello\n";

// Create the producer
//std::cout << "77777777777\n";
Producer producer(config);

std::cout << "Config read\n";

// Produce a message!
std::string message = "hey there!";
producer.produce(MessageBuilder("my_topic").partition(0).payload(message));
producer.flush();
//std::cout << "Message flushed\n";

The trace goes to this line: if (_Count > max_size()) { _Xlen_string(); // result too long }

If I use only Configuration config;, it doesn't crash.