Beispiel #1
0
 public PrepareReceiveQueueFilter(ReceiveSettings settings, IManagementPipe managementPipe, params ExchangeBindingSettings[] exchangeBindings)
 {
     _settings         = settings;
     _prefetchCount    = settings.PrefetchCount;
     _managementPipe   = managementPipe;
     _exchangeBindings = exchangeBindings;
 }
Beispiel #2
0
            public SetModelPrefetchCountConsumer(IManagementPipe managementPipe, ModelContext modelContext, ISetPrefetchCount filter)
            {
                _modelContext = modelContext;
                _filter       = filter;

                _handle = managementPipe.ConnectInstance(this);
            }
        public ConcurrencyLimitFilter(int concurrencyLimit, IManagementPipe managementPipe)
        {
            _concurrencyLimit = concurrencyLimit;

            _limit = new SemaphoreSlim(concurrencyLimit);

            _handle = managementPipe.ConnectInstance(this);
        }
        public RabbitMqReceiveEndpointSpecification(IRabbitMqHost host, RabbitMqReceiveSettings settings, IConsumePipe consumePipe)
            : base(consumePipe)
        {
            _host     = host;
            _settings = settings;

            _managementPipe   = new ManagementPipe();
            _exchangeBindings = new List <ExchangeBindingSettings>();
        }
        /// <summary>
        /// Adds a RabbitMQ Basic Consumer to the pipeline
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="pipe"></param>
        /// <param name="settings"></param>
        /// <param name="receiveObserver"></param>
        /// <param name="transportObserver"></param>
        /// <param name="exchangeBindings"></param>
        /// <param name="supervisor"></param>
        /// <param name="managementPipe"></param>
        /// <param name="sendEndpointProvider"></param>
        /// <param name="publishEndpointProvider"></param>
        /// <param name="host"></param>
        public static void RabbitMqConsumer(this IPipeConfigurator<ConnectionContext> configurator, IPipe<ReceiveContext> pipe, ReceiveSettings settings, IReceiveObserver receiveObserver, IReceiveTransportObserver transportObserver, IEnumerable<ExchangeBindingSettings> exchangeBindings, ITaskSupervisor supervisor, IManagementPipe managementPipe, ISendEndpointProvider sendEndpointProvider, IPublishEndpointProvider publishEndpointProvider, IRabbitMqHost host)
        {
            if (configurator == null)
                throw new ArgumentNullException(nameof(configurator));

            var pipeBuilderConfigurator = new RabbitMqConsumerPipeSpecification(pipe, settings, receiveObserver, transportObserver, exchangeBindings,
                supervisor, managementPipe, sendEndpointProvider, publishEndpointProvider, host);

            configurator.AddPipeSpecification(pipeBuilderConfigurator);
        }
        public RabbitMqReceiveEndpointSpecification(IRabbitMqHost host, IRabbitMqEndpointConfiguration configuration,
                                                    RabbitMqReceiveSettings settings)
            : base(configuration)
        {
            _host          = host;
            _configuration = configuration;
            _settings      = settings;

            _managementPipe = new ManagementPipe();
        }
        public RabbitMqReceiveTransport(IRabbitMqHost host, ReceiveSettings settings, IManagementPipe managementPipe,
            params ExchangeBindingSettings[] bindings)
        {
            _host = host;
            _settings = settings;
            _bindings = bindings;
            _managementPipe = managementPipe;

            _receiveObservable = new ReceiveObservable();
            _receiveEndpointObservable = new ReceiveEndpointObservable();
        }
Beispiel #8
0
        public RabbitMqReceiveTransport(IRabbitMqHost host, ReceiveSettings settings, IManagementPipe managementPipe,
                                        params ExchangeBindingSettings[] bindings)
        {
            _host           = host;
            _settings       = settings;
            _bindings       = bindings;
            _managementPipe = managementPipe;

            _receiveObservable         = new ReceiveObservable();
            _receiveEndpointObservable = new ReceiveEndpointObservable();
        }
Beispiel #9
0
        public RabbitMqReceiveTransport(IRabbitMqHost host, ReceiveSettings settings, IManagementPipe managementPipe, IRabbitMqReceiveEndpointTopology topology)
        {
            _host           = host;
            _settings       = settings;
            _topology       = topology;
            _managementPipe = managementPipe;

            _receiveObservable          = new ReceiveObservable();
            _receiveTransportObservable = new ReceiveTransportObservable();

            _inputAddress = topology.InputAddress;
        }
 public RabbitMqConsumerPipeSpecification(IPipe <ReceiveContext> receivePipe, ReceiveSettings settings, IReceiveObserver receiveObserver,
                                          IReceiveEndpointObserver endpointObserver, IEnumerable <ExchangeBindingSettings> exchangeBindings, ITaskSupervisor supervisor,
                                          IManagementPipe managementPipe)
 {
     _settings         = settings;
     _receiveObserver  = receiveObserver;
     _endpointObserver = endpointObserver;
     _supervisor       = supervisor;
     _exchangeBindings = exchangeBindings.ToArray();
     _receivePipe      = receivePipe;
     _managementPipe   = managementPipe;
     _modelSettings    = new RabbitMqModelSettings();
 }
        /// <summary>
        /// Adds a RabbitMQ Basic Consumer to the pipeline
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="pipe"></param>
        /// <param name="settings"></param>
        /// <param name="receiveObserver"></param>
        /// <param name="endpointObserver"></param>
        /// <param name="exchangeBindings"></param>
        /// <param name="supervisor"></param>
        /// <param name="managementPipe"></param>
        public static void RabbitMqConsumer(this IPipeConfigurator <ConnectionContext> configurator, IPipe <ReceiveContext> pipe, ReceiveSettings settings,
                                            IReceiveObserver receiveObserver, IReceiveEndpointObserver endpointObserver, IEnumerable <ExchangeBindingSettings> exchangeBindings,
                                            ITaskSupervisor supervisor, IManagementPipe managementPipe)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var pipeBuilderConfigurator = new RabbitMqConsumerPipeSpecification(pipe, settings, receiveObserver, endpointObserver, exchangeBindings,
                                                                                supervisor, managementPipe);

            configurator.AddPipeSpecification(pipeBuilderConfigurator);
        }
        public RabbitMqReceiveTransport(IRabbitMqHost host, ReceiveSettings settings, IManagementPipe managementPipe, ExchangeBindingSettings[] bindings, ISendEndpointProvider sendEndpointProvider, IPublishEndpointProvider publishEndpointProvider)
        {
            _host = host;
            _settings = settings;
            _bindings = bindings;
            _sendEndpointProvider = sendEndpointProvider;
            _publishEndpointProvider = publishEndpointProvider;
            _managementPipe = managementPipe;

            _receiveObservable = new ReceiveObservable();
            _receiveTransportObservable = new ReceiveTransportObservable();

            _inputAddress = _settings.GetInputAddress(_host.Settings.HostAddress);
        }
Beispiel #13
0
        public RabbitMqReceiveTransport(IRabbitMqHost host, ReceiveSettings settings, IManagementPipe managementPipe, ExchangeBindingSettings[] bindings, ISendEndpointProvider sendEndpointProvider, IPublishEndpointProvider publishEndpointProvider)
        {
            _host                    = host;
            _settings                = settings;
            _bindings                = bindings;
            _sendEndpointProvider    = sendEndpointProvider;
            _publishEndpointProvider = publishEndpointProvider;
            _managementPipe          = managementPipe;

            _receiveObservable          = new ReceiveObservable();
            _receiveTransportObservable = new ReceiveTransportObservable();

            _inputAddress = _settings.GetInputAddress(_host.Settings.HostAddress);
        }
Beispiel #14
0
        RabbitMqReceiveEndpointConfiguration(IRabbitMqHostConfiguration hostConfiguration, IRabbitMqEndpointConfiguration endpointConfiguration)
            : base(endpointConfiguration)
        {
            _hostConfiguration     = hostConfiguration;
            _endpointConfiguration = endpointConfiguration;

            _managementPipe         = new ManagementPipe();
            _connectionConfigurator = new PipeConfigurator <ConnectionContext>();
            _modelConfigurator      = new PipeConfigurator <ModelContext>();

            HostAddress = hostConfiguration.Host.Address;

            _inputAddress = new Lazy <Uri>(FormatInputAddress);
        }
        public RabbitMqReceiveEndpointConfigurator(IRabbitMqHost host, string queueName = null, IConsumePipe consumePipe = null)
            : base(consumePipe)
        {
            _host = host;

            _bindMessageExchanges = true;

            _settings = new RabbitMqReceiveSettings
            {
                QueueName = queueName,
            };

            _managementPipe   = new ManagementPipe();
            _exchangeBindings = new List <ExchangeBindingSettings>();
        }
        public RabbitMqReceiveEndpointSpecification(IRabbitMqHost host, IRabbitMqEndpointConfiguration configuration, string queueName = null)
            : base(configuration)
        {
            _host          = host;
            _configuration = configuration;

            _bindMessageExchanges = true;

            _settings = new RabbitMqReceiveSettings(queueName, configuration.Topology.Consume.ExchangeTypeSelector.DefaultExchangeType, true, false)
            {
                QueueName = queueName
            };

            _managementPipe = new ManagementPipe();
        }
Beispiel #17
0
 public RabbitMqConsumerPipeSpecification(IPipe <ReceiveContext> receivePipe, ReceiveSettings settings, IReceiveObserver receiveObserver,
                                          IReceiveTransportObserver transportObserver, IEnumerable <ExchangeBindingSettings> exchangeBindings, ITaskSupervisor supervisor,
                                          IManagementPipe managementPipe, ISendEndpointProvider sendEndpointProvider, IPublishEndpointProvider publishEndpointProvider, IRabbitMqHost host)
 {
     _settings                = settings;
     _receiveObserver         = receiveObserver;
     _transportObserver       = transportObserver;
     _supervisor              = supervisor;
     _exchangeBindings        = exchangeBindings.Distinct().ToArray();
     _receivePipe             = receivePipe;
     _managementPipe          = managementPipe;
     _sendEndpointProvider    = sendEndpointProvider;
     _publishEndpointProvider = publishEndpointProvider;
     _host = host;
 }
        public RabbitMqReceiveEndpointConfiguration(IRabbitMqHostConfiguration hostConfiguration, RabbitMqReceiveSettings settings,
                                                    IRabbitMqEndpointConfiguration endpointConfiguration)
            : base(endpointConfiguration)
        {
            _hostConfiguration = hostConfiguration;
            _settings          = settings;

            _endpointConfiguration = endpointConfiguration;

            BindMessageExchanges = true;

            _managementPipe         = new ManagementPipe();
            _connectionConfigurator = new PipeConfigurator <ConnectionContext>();
            _modelConfigurator      = new PipeConfigurator <ModelContext>();

            _inputAddress = new Lazy <Uri>(FormatInputAddress);
        }
        public RabbitMqReceiveEndpointConfiguration(IRabbitMqHostConfiguration hostConfiguration, RabbitMqReceiveSettings settings,
                                                    IRabbitMqEndpointConfiguration endpointConfiguration)
            : base(hostConfiguration, endpointConfiguration)
        {
            _hostConfiguration = hostConfiguration;
            _settings          = settings;

            _endpointConfiguration = endpointConfiguration;

            _managementPipe         = new ManagementPipe();
            _connectionConfigurator = new PipeConfigurator <ConnectionContext>();
            _modelConfigurator      = new PipeConfigurator <ModelContext>();

            _inputAddress = new Lazy <Uri>(FormatInputAddress);

            if (settings.QueueName == RabbitMqExchangeNames.ReplyTo)
            {
                settings.ExchangeName = null;
                settings.BindQueue    = true;
                settings.NoAck        = true;
            }
        }
Beispiel #20
0
        /// <summary>
        /// Adds a RabbitMQ Basic Consumer to the pipeline
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="pipe"></param>
        /// <param name="settings"></param>
        /// <param name="receiveObserver"></param>
        /// <param name="transportObserver"></param>
        /// <param name="supervisor"></param>
        /// <param name="managementPipe"></param>
        /// <param name="host"></param>
        /// <param name="topology"></param>
        public static void RabbitMqConsumer(this IPipeConfigurator <ConnectionContext> configurator, IPipe <ReceiveContext> pipe, ReceiveSettings settings,
                                            IReceiveObserver receiveObserver, IReceiveTransportObserver transportObserver, ITaskSupervisor supervisor, IManagementPipe managementPipe,
                                            IRabbitMqHost host, IRabbitMqReceiveEndpointTopology topology)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var pipeBuilderConfigurator = new RabbitMqConsumerPipeSpecification(pipe, settings, receiveObserver, transportObserver,
                                                                                supervisor, managementPipe, host, topology);

            configurator.AddPipeSpecification(pipeBuilderConfigurator);
        }
 public SetPrefetchCountManagementConsumer(IManagementPipe managementPipe, string queueName)
 {
     _managementPipe = managementPipe;
     _queueName      = queueName;
     _lastUpdated    = DateTime.UtcNow;
 }
        public ConcurrencyLimitPipeSpecification(int concurrencyLimit)
        {
            _concurrencyLimit = concurrencyLimit;

            _managementPipe = new ManagementPipe();
        }