Run-time errors while running consumer function
Hey! I am trying to implement a producer and a consumer functions in cppkafka for windows. The example code for the producer works OK. But I am having problems with the provided consumer code in the examples folder. I set up the zookeeper and kafka servers and ran a producer client in cmd. Even when I implemented a simple code (in MSVS 2015) with basic elements such as
Configuration config = { { "metadata.broker.list", "127.0.0.1:9092" } }; Consumer consumer(config); consumer.subscribe({ "test" });
I am receiving a Debug error when I run the executable (i.e., consumer.exe). It says abort() has been called. Any ideas? Can you provide the simplest consumer code such as the producer one in the readme.md???
That is really the simplest consumer code. Which exact line is blowing up? Which exception is being thrown?
Any updates on this?
Hey! Sorry for my late response. I had problems with the overloading of << operators while printing to console (such as cout << msg.get_key() and cout << msg.get_payload() << endl;). The build process threw linkage error LNK2019 given as follows:
Unresolved external symbol "class std::basic_ostream<char,struct std::char_traits
Anyways I managed to overcome this error by simply writing cout << string(msg.get_payload()); instead of cout << msg.get_payload().
Ah damn VC. Just fixed that issue, sorry about that.