public InMemoryBusBuilder(InMemoryHost inMemoryHost, ISendTransportProvider sendTransportProvider, BusHostCollection <IBusHostControl> hosts,
                                  IInMemoryEndpointConfiguration configuration)
            : base(hosts, configuration)
        {
            if (inMemoryHost == null)
            {
                throw new ArgumentNullException(nameof(inMemoryHost));
            }
            if (sendTransportProvider == null)
            {
                throw new ArgumentNullException(nameof(sendTransportProvider));
            }

            var busQueueName = GenerateBusQueueName();

            _inputAddress = new Uri(inMemoryHost.Address, $"{busQueueName}");

            InMemoryHost   = inMemoryHost;
            _configuration = configuration;

            var busEndpointSpecification = _configuration.CreateNewConfiguration(ConsumePipe);

            _busEndpointSpecification = new InMemoryReceiveEndpointSpecification(inMemoryHost.Address, busQueueName, sendTransportProvider,
                                                                                 busEndpointSpecification);

            inMemoryHost.ReceiveEndpointFactory = new InMemoryReceiveEndpointFactory(this, sendTransportProvider, configuration);
        }
Example #2
0
        public void ReceiveEndpoint(string queueName, Action <IInMemoryReceiveEndpointConfigurator> configureEndpoint)
        {
            var specification = new InMemoryReceiveEndpointSpecification(queueName);

            configureEndpoint?.Invoke(specification);

            AddReceiveEndpointSpecification(specification);
        }
        public void CreateReceiveEndpoint(string queueName, Action<IInMemoryReceiveEndpointConfigurator> configure)
        {
            var specification = new InMemoryReceiveEndpointSpecification(queueName);

            configure?.Invoke(specification);

            BusConfigurationResult.CompileResults(specification.Validate());

            specification.Apply(_builder);
        }
Example #4
0
        public void ReceiveEndpoint(string queueName, Action <IInMemoryReceiveEndpointConfigurator> configureEndpoint)
        {
            var specification = new InMemoryReceiveEndpointSpecification(InMemoryHost.Address, queueName);

            specification.ConnectConsumerConfigurationObserver(this);
            specification.ConnectSagaConfigurationObserver(this);

            configureEndpoint?.Invoke(specification);

            AddReceiveEndpointSpecification(specification);
        }
Example #5
0
        /// <summary>
        /// Creates a management endpoint which can be used by controllable filters on a bus intance
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static IManagementEndpointConfigurator ManagementEndpoint(this IInMemoryBusFactoryConfigurator configurator,
                                                                         Action <IReceiveEndpointConfigurator> configure = null)
        {
            var queueName = configurator.GetTemporaryQueueName("manage-");

            var specification = new InMemoryReceiveEndpointSpecification(configurator.Host.Address, queueName)
            {
                TransportConcurrencyLimit = 1
            };

            configure?.Invoke(specification);

            configurator.AddReceiveEndpointSpecification(specification);

            var managementEndpointConfigurator = new ManagementEndpointConfigurator(specification);

            return(managementEndpointConfigurator);
        }
        /// <summary>
        /// Creates a management endpoint which can be used by controllable filters on a bus intance
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static IManagementEndpointConfigurator ManagementEndpoint(this IInMemoryBusFactoryConfigurator configurator,
            Action<IReceiveEndpointConfigurator> configure = null)
        {
            var queueName = configurator.GetTemporaryQueueName("manage-");

            var specification = new InMemoryReceiveEndpointSpecification(queueName)
            {
                TransportConcurrencyLimit = 1
            };

            configure?.Invoke(specification);

            configurator.AddReceiveEndpointSpecification(specification);

            var managementEndpointConfigurator = new ManagementEndpointConfigurator(specification);

            return managementEndpointConfigurator;
        }
        public InMemoryBusBuilder(InMemoryHost inMemoryHost, ISendTransportProvider sendTransportProvider, BusHostCollection<IBusHostControl> hosts,
            IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory)
            : base(consumePipeFactory, sendPipeFactory, publishPipeFactory, hosts)
        {
            if (inMemoryHost == null)
                throw new ArgumentNullException(nameof(inMemoryHost));
            if (sendTransportProvider == null)
                throw new ArgumentNullException(nameof(sendTransportProvider));

            var busQueueName = GenerateBusQueueName();
            _inputAddress = new Uri($"loopback://localhost/{busQueueName}");

            InMemoryHost = inMemoryHost;
            _sendTransportProvider = sendTransportProvider;

            _busEndpointSpecification = new InMemoryReceiveEndpointSpecification(busQueueName, ConsumePipe);

            inMemoryHost.ReceiveEndpointFactory = new InMemoryReceiveEndpointFactory(this);
        }
Example #8
0
        public InMemoryBusBuilder(InMemoryHost inMemoryHost, ISendTransportProvider sendTransportProvider, BusHostCollection <IBusHostControl> hosts,
                                  IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory)
            : base(consumePipeFactory, sendPipeFactory, publishPipeFactory, hosts)
        {
            if (inMemoryHost == null)
            {
                throw new ArgumentNullException(nameof(inMemoryHost));
            }
            if (sendTransportProvider == null)
            {
                throw new ArgumentNullException(nameof(sendTransportProvider));
            }

            var busQueueName = GenerateBusQueueName();

            _inputAddress = new Uri($"loopback://localhost/{busQueueName}");

            InMemoryHost           = inMemoryHost;
            _sendTransportProvider = sendTransportProvider;

            _busEndpointSpecification = new InMemoryReceiveEndpointSpecification(busQueueName, ConsumePipe);

            inMemoryHost.ReceiveEndpointFactory = new InMemoryReceiveEndpointFactory(this);
        }