public async Task <T> ReceiveAsync <T>() where T : TelemetryMessage
        {
            var brokeredMsg = await _topicSubscriber.ReceiveFromTopicAsync(TopicNames.Telemetry, typeof(T).Name);

            return(brokeredMsg == null ? null : MessageMapper.Map <T>(brokeredMsg));
        }
Exemplo n.º 2
0
        public async Task RaiseAsync(NotificationMessage notification)
        {
            var brokeredMessage = MessageMapper.Map(notification);

            await _topicPublisher.SendToTopicAsync(TopicNames.Notifications, brokeredMessage);
        }
Exemplo n.º 3
0
        public async Task <T> ReceiveAsync <T>() where T : NotificationMessage
        {
            var brokeredMsg = await _topicSubscriber.ReceiveFromTopicAsync(TopicNames.Notifications, typeof(T).Name);

            return(brokeredMsg != null?MessageMapper.Map <T>(brokeredMsg) : null);
        }
        public async Task RaiseAsync(CommandMessage command)
        {
            var brokeredMessage = MessageMapper.Map(command);

            await _topicPublisher.SendToTopicAsync(TopicNames.Commands, brokeredMessage);
        }