コード例 #1
0
 public Dictionary <string, string> Deserialize(Message msmqMessage)
 {
     return(new Dictionary <string, string>()
     {
         { Headers.MessageId, msmqMessage.Id }
     });
 }
コード例 #2
0
        Message CreateMsmqMessage(TransportMessage message)
        {
            var headers = message.Headers;

            var expressDelivery = headers.ContainsKey(Headers.Express);
            var hasTimeout      = headers.TryGetValue(Headers.TimeToBeReceived, out var timeToBeReceivedStr);

            var msmqMessage = new Message
            {
                BodyStream         = new MemoryStream(message.Body),
                UseJournalQueue    = false,
                Recoverable        = !expressDelivery,
                UseDeadLetterQueue = !(expressDelivery || hasTimeout),
                Label = GetMessageLabel(message),
            };

            _msmqHeaderSerializer.SerializeToMessage(headers, msmqMessage);

            if (hasTimeout)
            {
                msmqMessage.TimeToBeReceived = TimeSpan.Parse(timeToBeReceivedStr);
            }

            return(msmqMessage);
        }
コード例 #3
0
 public void SerializeToMessage(Dictionary <string, string> headers, Message msmqMessage)
 {
 }