/// <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); }
public void CreateReceiveEndpoint(string queueName, Action<IRabbitMqReceiveEndpointConfigurator> configure) { var endpointConfigurator = new RabbitMqReceiveEndpointSpecification(_host, queueName); configure?.Invoke(endpointConfigurator); BusConfigurationResult.CompileResults(endpointConfigurator.Validate()); endpointConfigurator.Apply(_builder); }
public void CreateReceiveEndpoint(string queueName, Action <IRabbitMqReceiveEndpointConfigurator> configure) { var endpointConfigurator = new RabbitMqReceiveEndpointSpecification(_host, queueName); configure?.Invoke(endpointConfigurator); BusConfigurationResult.CompileResults(endpointConfigurator.Validate()); endpointConfigurator.Apply(_builder); }
public RabbitMqBusBuilder(BusHostCollection <RabbitMqHost> hosts, IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory, RabbitMqReceiveSettings busSettings) : base(consumePipeFactory, sendPipeFactory, publishPipeFactory, hosts) { _hosts = hosts; _busEndpointSpecification = new RabbitMqReceiveEndpointSpecification(_hosts[0], busSettings, ConsumePipe); foreach (var host in hosts.Hosts) { var factory = new RabbitMqReceiveEndpointFactory(this, host); host.ReceiveEndpointFactory = factory; } }
public RabbitMqBusBuilder(BusHostCollection<RabbitMqHost> hosts, IConsumePipeFactory consumePipeFactory, ISendPipeFactory sendPipeFactory, IPublishPipeFactory publishPipeFactory, RabbitMqReceiveSettings busSettings) : base(consumePipeFactory, sendPipeFactory, publishPipeFactory, hosts) { _hosts = hosts; _busEndpointSpecification = new RabbitMqReceiveEndpointSpecification(_hosts[0], busSettings, ConsumePipe); foreach (var host in hosts.Hosts) { var factory = new RabbitMqReceiveEndpointFactory(this, host); host.ReceiveEndpointFactory = factory; } }
public RabbitMqBusBuilder(BusHostCollection <RabbitMqHost> hosts, RabbitMqReceiveSettings busSettings, IRabbitMqEndpointConfiguration configuration) : base(hosts, configuration) { _hosts = hosts; var endpointConfiguration = configuration.CreateNewConfiguration(ConsumePipe); _busEndpointSpecification = new RabbitMqReceiveEndpointSpecification(_hosts[0], endpointConfiguration, busSettings); foreach (var host in hosts.Hosts) { var factory = new RabbitMqReceiveEndpointFactory(this, host, configuration); host.ReceiveEndpointFactory = factory; } }
/// <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; }