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); }
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); }
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); } } } }