Example #1
0
 private static void ValidateMqttAttribute(MqttAttribute attribute, Type parameterType)
 {
     if (string.IsNullOrWhiteSpace(attribute?.TopicName))
     {
         throw new ArgumentException("Value cannot be empty.", nameof(attribute.TopicName));
     }
 }
Example #2
0
        private IAsyncCollector <MqttMessage> BuildCollectorFromAttribute(MqttAttribute attribute)
        {
            var topicName = attribute.TopicName;

            var client = _messagingProvider.GetMessageClient(topicName);

            return(new MqttMessageAsyncCollector(client));
        }
Example #3
0
 private MqttMessage BuildMessageFromAttribute(MqttAttribute attribute)
 {
     return(new MqttMessage {
         Topic = attribute.TopicName
     });
 }