public void UpdateConversations(TraceMessage trace)
        {
            var conversationId     = trace.ConversationId;
            var processedMessageId = trace.IncomingMessageId;
            var inflightMessageIds = trace.OutgoingMessageId;

            if (conversations.ContainsKey(conversationId) == false)
            {
                return;
            }

            conversations.AddOrUpdate(
                conversationId,
                id => throw new Exception("Invalid conversation tracking state."),
                (id, s) => s.Update(processedMessageId, inflightMessageIds));
        }
示例#2
0
        public override async Task Invoke(IIncomingLogicalMessageContext context, Func <Task> next)
        {
            await next().ConfigureAwait(false);

            var outgoingMessages = context.Extensions.Get <PendingTransportOperations>();

            var trace = new TraceMessage
            {
                ConversationId    = Guid.Parse(context.Headers[Headers.ConversationId]),
                IncomingMessageId = Guid.Parse(context.Headers[Headers.MessageId])
                                    /*TODO: add missing code here */
            };

            var sendOptions = new SendOptions();

            sendOptions.SetDestination("trace");

            await context.Send(trace, sendOptions);
        }
示例#3
0
        public override async Task Invoke(IIncomingLogicalMessageContext context, Func <Task> next)
        {
            await next().ConfigureAwait(false);

            var pending = context.Extensions.Get <PendingTransportOperations>();

            var trace = new TraceMessage
            {
                ConversationId    = Guid.Parse(context.Headers[Headers.ConversationId]),
                IncomingMessageId = Guid.Parse(context.Headers[Headers.MessageId]),
                OutgoingMessageId = pending.Operations.Select(o => Guid.Parse((string)o.Message.Headers[Headers.MessageId]))
                                    .ToArray()
            };

            var sendOptions = new SendOptions();

            sendOptions.SetDestination("trace");

            await context.Send(trace, sendOptions);
        }