async Task IFilter <ExceptionReceiveContext> .Send(ExceptionReceiveContext context, IPipe <ExceptionReceiveContext> next)
        {
            ISendTransport transport = await _getDestinationTransport();

            IPipe <SendContext> pipe = Pipe.Execute <SendContext>(sendContext =>
            {
                sendContext.Headers.Set(MessageHeaders.Reason, "fault");

                Exception exception = context.Exception.GetBaseException();

                sendContext.Headers.Set(MessageHeaders.FaultMessage, exception.Message);
                sendContext.Headers.Set(MessageHeaders.FaultStackTrace, ExceptionUtil.GetStackTrace(exception));

                sendContext.SetHostHeaders();
            });

            if (!context.IsFaulted)
            {
                GenerateFault(context);
            }

            await transport.Move(context, pipe);

            await next.Send(context);
        }
Exemplo n.º 2
0
        async Task IFilter <ReceiveContext> .Send(ReceiveContext context, IPipe <ReceiveContext> next)
        {
            ISendTransport transport = await _getDestinationTransport.Value.ConfigureAwait(false);

            IPipe <SendContext> pipe = Pipe.Execute <SendContext>(sendContext =>
            {
                sendContext.Headers.Set(MessageHeaders.Reason, _reason);

                sendContext.SetHostHeaders();
            });

            await transport.Move(context, pipe).ConfigureAwait(false);

            await next.Send(context).ConfigureAwait(false);
        }
Exemplo n.º 3
0
        async Task IFilter <ReceiveContext> .Send(ReceiveContext context, IPipe <ReceiveContext> next)
        {
            ISendTransport transport = await _getDestinationTransport();

            IPipe <SendContext> pipe = Pipe.Execute <SendContext>(sendContext =>
            {
                sendContext.Headers.Set("MT-Reason", _reason);

                sendContext.SetHostHeaders();
            });

            await transport.Move(context, pipe);

            await next.Send(context);
        }
Exemplo n.º 4
0
        async Task IFilter <ExceptionReceiveContext> .Send(ExceptionReceiveContext context, IPipe <ExceptionReceiveContext> next)
        {
            ISendTransport transport = await _getDestinationTransport();

            IPipe <SendContext> pipe = Pipe.Execute <SendContext>(sendContext =>
            {
                sendContext.Headers.Set("MT-Reason", "fault");

                Exception exception = context.Exception.GetBaseException();

                sendContext.Headers.Set("MT-Fault-Message", exception.Message);
                sendContext.Headers.Set("MT-Fault-StackTrace", exception.StackTrace);

                sendContext.SetHostHeaders();
            });

            await transport.Move(context, pipe);

            await next.Send(context);
        }