示例#1
0
        public InboundMessageInterceptor(Func <IPipelineSink <IConsumeContext>, IPipelineSink <IConsumeContext> > insertAfter,
                                         IInboundMessageInterceptor interceptor)
        {
            _interceptor = interceptor;

            _output = insertAfter(this);
        }
		public InboundMessageInterceptor Create(IInboundMessageInterceptor messageInterceptor)
		{
			var scope = new InboundMessageInterceptorConfiguratorScope();
			_sink.Inspect(scope);

			return ConfigureInterceptor(scope.InsertAfter, messageInterceptor);
		}
示例#3
0
        public InboundMessageInterceptor Create(IInboundMessageInterceptor messageInterceptor)
        {
            var scope = new InboundMessageInterceptorConfiguratorScope();

            _sink.Inspect(scope);

            return(ConfigureInterceptor(scope.InsertAfter, messageInterceptor));
        }
		static InboundMessageInterceptor ConfigureInterceptor(
			Func<IPipelineSink<IConsumeContext>, IPipelineSink<IConsumeContext>> insertAfter,
			IInboundMessageInterceptor messageInterceptor)
		{
			if (insertAfter == null)
				throw new PipelineException("Unable to insert filter into pipeline for message type " + typeof (object).FullName);

			var interceptor = new InboundMessageInterceptor(insertAfter, messageInterceptor);

			return interceptor;
		}
        /// <summary>
        /// Adds an inbound message interceptor to the bus configuration
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="interceptor"></param>
        public static void AddInboundInterceptor(this ServiceBusConfigurator configurator,
            IInboundMessageInterceptor interceptor)
        {
            var builderConfigurator = new PostCreateBusBuilderConfigurator(bus =>
                {
                    var interceptorConfigurator = new InboundMessageInterceptorConfigurator(bus.InboundPipeline);

                    interceptorConfigurator.Create(interceptor);
                });

            configurator.AddBusConfigurator(builderConfigurator);
        }
示例#6
0
        /// <summary>
        /// Adds an inbound message interceptor to the bus configuration
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="interceptor"></param>
        public static void AddInboundInterceptor(this ServiceBusConfigurator configurator,
                                                 IInboundMessageInterceptor interceptor)
        {
            var builderConfigurator = new PostCreateBusBuilderConfigurator(bus =>
            {
                var interceptorConfigurator = new InboundMessageInterceptorConfigurator(bus.InboundPipeline);

                interceptorConfigurator.Create(interceptor);
            });

            configurator.AddBusConfigurator(builderConfigurator);
        }
示例#7
0
        static InboundMessageInterceptor ConfigureInterceptor(
            Func <IPipelineSink <IConsumeContext>, IPipelineSink <IConsumeContext> > insertAfter,
            IInboundMessageInterceptor messageInterceptor)
        {
            if (insertAfter == null)
            {
                throw new PipelineException("Unable to insert filter into pipeline for message type " + typeof(object).FullName);
            }

            var interceptor = new InboundMessageInterceptor(insertAfter, messageInterceptor);

            return(interceptor);
        }