Exemplo n.º 1
0
        private async Task processEvents(IEnumerable <EventData> messages)
        {
            foreach (EventData eventData in messages)
            {
                try
                {
                    updateCurrentMsgCountBySizeInBytes(eventData.SerializedSizeInBytes);

                    string deviceId = getDeviceId(eventData);
                    if (deviceId == null)
                    {
                        continue;
                    }

                    if (isTwinChangedEvent(eventData))
                    {
                        processTwinChangedEvent(eventData);
                    }
                    else
                    {
                        await processMessageEvent(deviceId, eventData);
                    }
                }
                catch (Exception ex)
                {
                    _consoleLog.Warn("(Skipped) Unsupported Message:{0}", ex.Message.ToString());
                    _consoleLog.BlobLogWarn("(Skipped) Unsupported Message:{0}", ex.Message.ToString());
                }
            }
        }