Merge pull request #109 from Telecominfraproject/WIFI-13597-fix-kafka-producer-using-poll

fix: modified kafka manager to use poll in producer
This commit is contained in:
i-chvets
2024-06-13 14:35:18 -04:00
committed by GitHub

View File

@@ -107,7 +107,7 @@ namespace OpenWifi {
NewMessage.partition(0);
NewMessage.payload(Msg->Payload());
Producer.produce(NewMessage);
Producer.flush();
Producer.poll((std::chrono::milliseconds) 0);
}
} catch (const cppkafka::HandleException &E) {
poco_warning(Logger_,
@@ -117,6 +117,10 @@ namespace OpenWifi {
} catch (...) {
poco_error(Logger_, "std::exception");
}
if (Queue_.size() == 0) {
// message queue is empty, flush all previously sent messages
Producer.flush();
}
Note = Queue_.waitDequeueNotification();
}
poco_information(Logger_, "Stopped...");