예제 #1
0
        protected IReceivePipe CreateReceivePipe(IBusBuilder builder, Func <IConsumePipe, IReceiveEndpointBuilder> endpointBuilderFactory)
        {
            IConsumePipe consumePipe = _consumePipe ?? builder.CreateConsumePipe(_consumePipeConfigurator);

            IReceiveEndpointBuilder endpointBuilder = endpointBuilderFactory(consumePipe);

            foreach (IReceiveEndpointSpecification specification in _specifications)
            {
                specification.Configure(endpointBuilder);
            }

            ConfigureAddDeadLetterFilter(builder.SendTransportProvider);

            var publishEndpointProvider = builder.CreatePublishEndpointProvider(_publishPipeConfigurator);

            ConfigureRescueFilter(publishEndpointProvider, builder.SendTransportProvider);

            ISendEndpointProvider sendEndpointProvider = builder.CreateSendEndpointProvider(_sendPipeConfigurator);

            IMessageDeserializer messageDeserializer = builder.GetMessageDeserializer(sendEndpointProvider, publishEndpointProvider);

            _receiveConfigurator.UseFilter(new DeserializeFilter(messageDeserializer, consumePipe));

            var receivePipe = _receiveConfigurator.Build();

            return(new ReceivePipe(receivePipe, consumePipe));
        }
        protected IPipe <ReceiveContext> CreateReceivePipe(IBusBuilder builder, Func <IConsumePipe, IReceiveEndpointBuilder> endpointBuilderFactory)
        {
            IConsumePipe consumePipe = _consumePipe ?? builder.CreateConsumePipe(_consumePipeSpecification);

            IReceiveEndpointBuilder endpointBuilder = endpointBuilderFactory(consumePipe);

            foreach (IReceiveEndpointSpecification specification in _specifications)
            {
                specification.Configure(endpointBuilder);
            }

            ConfigureAddDeadLetterFilter(builder.SendTransportProvider);

            ConfigureRescueFilter(builder.SendTransportProvider);

            _receiveConfigurator.UseFilter(new DeserializeFilter(builder.MessageDeserializer, consumePipe));

            return(_receiveConfigurator.Build());
        }
 protected IConsumePipe CreateConsumePipe(IBusBuilder builder)
 {
     return(_consumePipe ?? builder.CreateConsumePipe(_consumePipeSpecification));
 }