void AddRescueFilter(IReceiveEndpointBuilder builder) { IPipe <ExceptionReceiveContext> moveToErrorPipe = Pipe.New <ExceptionReceiveContext>(x => { Func <Task <ISendTransport> > getErrorTransport = () => builder.SendTransportProvider.GetSendTransport(_errorAddress.Value); var publishEndpointProvider = builder.CreatePublishEndpointProvider(InputAddress, _publishPipeConfigurator); x.UseFilter(new MoveExceptionToTransportFilter(publishEndpointProvider, _errorAddress.Value, getErrorTransport)); }); _receiveConfigurator.UseRescue(moveToErrorPipe); }
protected IPublishEndpointProvider CreatePublishEndpointProvider(IReceiveEndpointBuilder builder) { return(builder.CreatePublishEndpointProvider(InputAddress, _publishPipeConfigurator)); }