コード例 #1
0
        async Task Execute(BehaviorContext <TInstance> context)
        {
            ConsumeEventContext <TInstance> consumeContext = context.CreateConsumeContext();

            var message = await _asyncMessageFactory(consumeContext).ConfigureAwait(false);

            ITopicProducer <TMessage> producer = context.GetProducer <TMessage>();

            await producer.Produce(message, _pipe).ConfigureAwait(false);
        }
コード例 #2
0
        async Task Execute(BehaviorContext <TInstance> context)
        {
            ConsumeEventContext <TInstance> consumeContext = context.CreateConsumeContext();

            var message = await _asyncMessageFactory(consumeContext).ConfigureAwait(false);

            var producer = await context.GetProducer(consumeContext, _nameProvider(consumeContext));

            await producer.Produce(message, _pipe).ConfigureAwait(false);
        }
コード例 #3
0
        async Task Faulted(BehaviorContext <TInstance> context)
        {
            if (context.TryGetExceptionContext(out ConsumeExceptionEventContext <TInstance, TException> exceptionContext))
            {
                var message = await _asyncMessageFactory(exceptionContext).ConfigureAwait(false);

                var producer = await context.GetProducer(exceptionContext, _nameProvider(exceptionContext));

                await producer.Produce(message, _pipe).ConfigureAwait(false);
            }
        }