Esempio n. 1
0
        private static void OnConnected(object param, MqttClientConnectedEventArgs args)
        {
            Console.WriteLine("### CLIENT CONNECTING ###");
            SystemEvent systemEvent = new SystemEvent(SystemEventTypesEnum.DeviceOnline, null, null, args.ClientId);
            var         jsonMessage = JsonConvert.SerializeObject(systemEvent, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });

            producer.ProduceMessage(Literals.KAFKA_TOPIC_DEVICESTATUS, jsonMessage);
            Console.WriteLine("### CLIENT CONNECTED ###");
        }