/// <summary>
        /// Registers a management endpoint on the bus, which can be used to control
        /// filters and other management control points on the bus.
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="host">The host where the endpoint is to be created</param>
        /// <param name="configure">Configure additional values of the underlying receive endpoint</param>
        /// <returns></returns>
        public static IManagementEndpointConfigurator ManagementEndpoint(this IRabbitMqBusFactoryConfigurator configurator,
                                                                         IRabbitMqHost host, Action <IRabbitMqReceiveEndpointConfigurator> configure = null)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }
            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }

            var queueName = host.GetTemporaryQueueName("manage-");

            var endpointConfigurator = new RabbitMqReceiveEndpointSpecification(host, queueName)
            {
                AutoDelete = true,
                Durable    = false
            };

            configure?.Invoke(endpointConfigurator);

            configurator.AddReceiveEndpointSpecification(endpointConfigurator);

            var managementEndpointConfigurator = new ManagementEndpointConfigurator(endpointConfigurator);

            return(managementEndpointConfigurator);
        }
        /// <summary>
        /// Registers a management endpoint on the bus, which can be used to control
        /// filters and other management control points on the bus.
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="host">The host where the endpoint is to be created</param>
        /// <param name="configure">Configure additional values of the underlying receive endpoint</param>
        /// <returns></returns>
        public static IManagementEndpointConfigurator ManagementEndpoint(this IRabbitMqBusFactoryConfigurator configurator,
                                                                         IRabbitMqHost host, Action <IRabbitMqReceiveEndpointConfigurator> configure = null)
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }
            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }

            var queueName = host.Topology.CreateTemporaryQueueName("manage-");

            IRabbitMqReceiveEndpointConfigurator specification = null;

            configurator.ReceiveEndpoint(host, queueName, x =>
            {
                x.AutoDelete = true;
                x.Durable    = false;

                configure?.Invoke(x);

                specification = x;
            });

            var managementEndpointConfigurator = new ManagementEndpointConfigurator(specification);

            return(managementEndpointConfigurator);
        }
Пример #3
0
        public static IManagementEndpointConfigurator ManagementEndpoint(this IInMemoryBusFactoryConfigurator configurator,
                                                                         Action <IReceiveEndpointConfigurator> configure = null)
        {
            var queueName = configurator.GetTemporaryQueueName("manage-");

            var endpointConfigurator = new InMemoryReceiveEndpointConfigurator(queueName)
            {
                TransportConcurrencyLimit = 1
            };

            configure?.Invoke(endpointConfigurator);

            configurator.AddBusFactorySpecification(endpointConfigurator);

            var managementEndpointConfigurator = new ManagementEndpointConfigurator(endpointConfigurator);

            return(managementEndpointConfigurator);
        }
Пример #4
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-");

            IInMemoryReceiveEndpointConfigurator specification = null;

            configurator.ReceiveEndpoint(queueName, x =>
            {
                specification = x;
            });

            configure?.Invoke(specification);

            var managementEndpointConfigurator = new ManagementEndpointConfigurator(specification);

            return(managementEndpointConfigurator);
        }