Esempio n. 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);
		}
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }