mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
				synced 2025-10-30 18:27:49 +00:00 
			
		
		
		
	Merge pull request #112 from Telecominfraproject/WIFI-13597-fix-kafka-producer-using-poll
Wifi 13597 fix kafka producer using poll
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,8 +117,13 @@ 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(); | ||||
| 		poco_information(Logger_, "Stopped..."); | ||||
| 	} | ||||
|  | ||||
| @@ -324,4 +329,4 @@ namespace OpenWifi { | ||||
| 											   partitions.front().get_partition())); | ||||
| 	} | ||||
|  | ||||
| } // namespace OpenWifi | ||||
| } // namespace OpenWifi | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 i-chvets
					i-chvets