diff --git a/build b/build index 62f9457..c793025 100644 --- a/build +++ b/build @@ -1 +1 @@ -6 \ No newline at end of file +7 \ No newline at end of file diff --git a/src/RESTObjects/RESTAPI_ProvObjects.cpp b/src/RESTObjects/RESTAPI_ProvObjects.cpp index 2a139f5..8cdb878 100644 --- a/src/RESTObjects/RESTAPI_ProvObjects.cpp +++ b/src/RESTObjects/RESTAPI_ProvObjects.cpp @@ -587,6 +587,9 @@ namespace OpenWifi::ProvObjects { field_to_json(Obj, "locale", locale); field_to_json(Obj, "realMacAddress", realMacAddress); field_to_json(Obj, "doNotAllowOverrides", doNotAllowOverrides); + field_to_json(Obj, "imported", imported); + field_to_json(Obj, "connected", connected); + field_to_json(Obj, "platform", platform); } bool InventoryTag::from_json(const Poco::JSON::Object::Ptr &Obj) { @@ -609,6 +612,9 @@ namespace OpenWifi::ProvObjects { field_from_json(Obj, "locale", locale); field_from_json(Obj, "realMacAddress", realMacAddress); field_from_json(Obj, "doNotAllowOverrides", doNotAllowOverrides); + field_from_json(Obj, "imported", imported); + field_from_json(Obj, "connected", connected); + field_from_json(Obj, "platform", platform); return true; } catch (...) { } diff --git a/src/RESTObjects/RESTAPI_ProvObjects.h b/src/RESTObjects/RESTAPI_ProvObjects.h index 6014d61..8f11867 100644 --- a/src/RESTObjects/RESTAPI_ProvObjects.h +++ b/src/RESTObjects/RESTAPI_ProvObjects.h @@ -490,9 +490,11 @@ namespace OpenWifi::ProvObjects { std::string locale; std::string realMacAddress; bool doNotAllowOverrides = false; + std::uint64_t imported=0; + std::uint64_t connected=0; + std::string platform{"AP"}; void to_json(Poco::JSON::Object &Obj) const; - bool from_json(const Poco::JSON::Object::Ptr &Obj); }; diff --git a/src/framework/KafkaManager.cpp b/src/framework/KafkaManager.cpp index f2936e7..9605736 100644 --- a/src/framework/KafkaManager.cpp +++ b/src/framework/KafkaManager.cpp @@ -79,8 +79,10 @@ namespace OpenWifi { Utils::SetThreadName("Kafka:Prod"); cppkafka::Configuration Config( {{"client.id", MicroServiceConfigGetString("openwifi.kafka.client.id", "")}, - {"metadata.broker.list", - MicroServiceConfigGetString("openwifi.kafka.brokerlist", "")}}); + {"metadata.broker.list",MicroServiceConfigGetString("openwifi.kafka.brokerlist", "")} // , + // {"send.buffer.bytes", KafkaManager()->KafkaManagerMaximumPayloadSize() } + } + ); AddKafkaSecurity(Config); @@ -275,6 +277,7 @@ namespace OpenWifi { int KafkaManager::Start() { if (!KafkaEnabled_) return 0; + MaxPayloadSize_ = MicroServiceConfigGetInt("openwifi.kafka.max.payload", 250000); ConsumerThr_.Start(); ProducerThr_.Start(); return 0; diff --git a/src/framework/KafkaManager.h b/src/framework/KafkaManager.h index e6272d3..75b9aa6 100644 --- a/src/framework/KafkaManager.h +++ b/src/framework/KafkaManager.h @@ -94,11 +94,14 @@ namespace OpenWifi { return ConsumerThr_.UnregisterTopicWatcher(Topic,Id); } + std::uint64_t KafkaManagerMaximumPayloadSize() const { return MaxPayloadSize_; } + private: bool KafkaEnabled_ = false; std::string SystemInfoWrapper_; KafkaProducer ProducerThr_; KafkaConsumer ConsumerThr_; + std::uint64_t MaxPayloadSize_ = 250000; void PartitionAssignment(const cppkafka::TopicPartitionList &partitions); void PartitionRevocation(const cppkafka::TopicPartitionList &partitions);