Skip to content

Commit

Permalink
Merge pull request #360 from Telecominfraproject/WIFI-13597-fix-kafka…
Browse files Browse the repository at this point in the history
…-producer-using-poll

WIFI-13597: fix: modified kafka manager to use poll in producer
  • Loading branch information
stephb9959 authored Jun 12, 2024
2 parents 1d88bb5 + c7ed7fb commit 02a0eef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/framework/KafkaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_,
Expand All @@ -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...");
Expand Down

0 comments on commit 02a0eef

Please sign in to comment.