コード例 #1
0
        public TransportMessage(TransportMessage message)
        {
            Headers = new Dictionary<string, string>
            {
                {HeaderKeys.MessageId, message.Id},
                {HeaderKeys.CorrelationId, message.CorrelationId},
                {HeaderKeys.MessageType, message.MessageType},
                {HeaderKeys.ReplyTo, message.ReplyTo?.ToString() }
            };

            var stream = new MemoryStream();
            message.Body.Position = 0;
            message.Body.CopyTo(stream);
            stream.Position = 0;
            SetBody(stream);

            foreach (var pair in message.Headers)
            {
                if (!Headers.ContainsKey(pair.Key))
                {
                    Headers.Add(pair.Key, pair.Value);
                }
            }
        }
コード例 #2
0
ファイル: Script.cs プロジェクト: danielmarbach/async-dolls
 static Task Connector(ChainFactory factory, TransportMessage message)
 {
     var pipeline = factory.Create();
     var context = new IncomingContext(message);
     return pipeline.Invoke(context);
 }
コード例 #3
0
 public IncomingContext(TransportMessage message)
 {
     Set(message);
     Exceptions = new Queue<ExceptionDispatchInfo>();
 }