Esempio n. 1
0
 static async Task SendMessageWithOjbet()
 {
     //sent object instead of string
     DTOLibrary.MessageDTO messageDTO = new DTOLibrary.MessageDTO();
     messageDTO.Subject = "Hello";
     messageDTO.Content = "I'm a object";
     await topicClient.SendCompressorAsync(messageDTO);
 }
Esempio n. 2
0
        static async Task SendMessageWithOjbet()
        {
            var settings = new SBCompressor.Configuration.StorageSettingData(
                "DefaultEndpointsProtocol=https;AccountName=stsbcompressordevweu001;AccountKey=***REMOVED***;EndpointSuffix=core.windows.net",
                "sbcompressorcontainer", SBCompressor.VeryLargeMessageStrategy.Storage);

            //sent object instead of string
            DTOLibrary.MessageDTO messageDTO = new DTOLibrary.MessageDTO();
            messageDTO.Subject = "Hello";
            messageDTO.Content = "I'm a object";
            await queueClient.SendCompressorAsync(messageDTO, settings);
        }
Esempio n. 3
0
 private static void ProcessMessages(MessageReceivedEventArgs e)
 {
     // Process the message.
     if (!string.IsNullOrEmpty(e.ReceivedEventMessage.Body))
     {
         Console.WriteLine($"Received message: SequenceNumber:{e.ReceivedMessage.SystemProperties.SequenceNumber} Body:{e.ReceivedEventMessage.Body}");
     }
     else
     {
         if (typeof(DTOLibrary.MessageDTO).AssemblyQualifiedName == e.ReceivedEventMessage.ObjectName)
         {
             DTOLibrary.MessageDTO msgDTO = e.ReceivedEventMessage.BodyObject as DTOLibrary.MessageDTO;
             if (msgDTO != null)
             {
                 Console.WriteLine(msgDTO.Subject + " " + msgDTO.Content);
             }
         }
     }
 }