Signed-off-by: Ivan Chvets <ivan.chvets@kinarasystems.com>
This commit is contained in:
Ivan Chvets
2025-05-01 17:49:04 -04:00
parent 1bd1cf0af6
commit fe6023b18d

View File

@@ -118,6 +118,10 @@ namespace OpenWifi {
Producer.poll((std::chrono::milliseconds) 0);
}
}
if (Queue_.size() == 0) {
// message queue is empty, flush all previously sent messages
Producer.flush();
}
} catch (const cppkafka::HandleException &E) {
poco_warning(Logger_,
fmt::format("Caught a Kafka exception (producer): {}", E.what()));
@@ -126,10 +130,6 @@ 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();
}
Producer.flush();