mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-10-29 18:02:29 +00:00
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:
@@ -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...");
|
||||
|
||||
Reference in New Issue
Block a user