mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 11:07:46 +00:00
Compare commits
3 Commits
v3.1.0-RC1
...
WIFI-13597
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ae0b99f55 | ||
|
|
d7e05eac60 | ||
|
|
3b8a8bafff |
@@ -107,7 +107,16 @@ namespace OpenWifi {
|
|||||||
NewMessage.partition(0);
|
NewMessage.partition(0);
|
||||||
NewMessage.payload(Msg->Payload());
|
NewMessage.payload(Msg->Payload());
|
||||||
Producer.produce(NewMessage);
|
Producer.produce(NewMessage);
|
||||||
Producer.flush();
|
if (Queue_.size() < 100) {
|
||||||
|
// use flush when internal queue is lightly loaded, i.e. flush after each
|
||||||
|
// message
|
||||||
|
Producer.flush();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// use poll when internal queue is loaded to allow messages to be sent in
|
||||||
|
// batches
|
||||||
|
Producer.poll((std::chrono::milliseconds) 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (const cppkafka::HandleException &E) {
|
} catch (const cppkafka::HandleException &E) {
|
||||||
poco_warning(Logger_,
|
poco_warning(Logger_,
|
||||||
@@ -117,8 +126,13 @@ namespace OpenWifi {
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
poco_error(Logger_, "std::exception");
|
poco_error(Logger_, "std::exception");
|
||||||
}
|
}
|
||||||
|
if (Queue_.size() == 0) {
|
||||||
|
// message queue is empty, flush all previously sent messages
|
||||||
|
Producer.flush();
|
||||||
|
}
|
||||||
Note = Queue_.waitDequeueNotification();
|
Note = Queue_.waitDequeueNotification();
|
||||||
}
|
}
|
||||||
|
Producer.flush();
|
||||||
poco_information(Logger_, "Stopped...");
|
poco_information(Logger_, "Stopped...");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,4 +338,4 @@ namespace OpenWifi {
|
|||||||
partitions.front().get_partition()));
|
partitions.front().get_partition()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace OpenWifi
|
} // namespace OpenWifi
|
||||||
|
|||||||
Reference in New Issue
Block a user