Exemple #1
0
        public async Task Consume(ConsumeContext <T> context)
        {
            var message      = context.Message;
            var activityType = nameof(ReceiveMassTransitMessage);
            var input        = new Variables();

            input.SetVariable(Constants.MessageInputKey, message);
            input.SetVariable(Constants.MessageTypeNameInputKey, typeof(T).AssemblyQualifiedName);

            Guid?correlationId = default;

            foreach (var item in CorrelationIdSelectors)
            {
                if (item.TryGetCorrelationId(message, out correlationId))
                {
                    break;
                }
            }

            await workflowInvoker.TriggerAsync(
                activityType,
                input,
                correlationId.ToString(),
                x => ReceiveMassTransitMessage.GetMessageType(x) == message.GetType(),
                context.CancellationToken);
        }
Exemple #2
0
        public async Task Consume(ConsumeContext <T> context)
        {
            var message      = context.Message;
            var activityType = nameof(ReceiveMassTransitMessage);
            var input        = new Variables {
                ["message"] = message
            };
            var correlationId = context.CorrelationId?.ToString();

            await workflowInvoker.TriggerAsync(
                activityType,
                input,
                correlationId,
                x => ReceiveMassTransitMessage.GetMessageType(x) == message.GetType(),
                context.CancellationToken);
        }