public HostReceiveEndpointHandle ConnectSubscriptionEndpoint(string subscriptionName, string topicName, Action <IServiceBusSubscriptionEndpointConfigurator> configure = null) { var settings = new SubscriptionEndpointSettings(topicName, subscriptionName); return(ConnectSubscriptionEndpoint(settings, configure)); }
IBrokeredMessageReceiver CreateBrokeredMessageReceiver(string topicPath, string subscriptionName, Action <IReceiveEndpointConfigurator> configure) { if (string.IsNullOrWhiteSpace(topicPath)) { throw new ArgumentNullException(nameof(topicPath)); } if (configure == null) { throw new ArgumentNullException(nameof(configure)); } var subscriptionPath = EntityNameHelper.FormatSubscriptionPath(topicPath, subscriptionName); return(_receivers.GetOrAdd(subscriptionPath, name => { var topicConfigurator = new TopicConfigurator(topicPath, false); var settings = new SubscriptionEndpointSettings(topicConfigurator.GetTopicDescription(), subscriptionName); var endpointConfiguration = _hostConfiguration.CreateSubscriptionEndpointConfiguration(settings); var configurator = new SubscriptionBrokeredMessageReceiverConfiguration(_hostConfiguration, endpointConfiguration); configure(configurator); return configurator.Build(); })); }
public HostReceiveEndpointHandle ConnectSubscriptionEndpoint <T>(string subscriptionName, Action <IServiceBusSubscriptionEndpointConfigurator> configure = null) where T : class { var settings = new SubscriptionEndpointSettings(Topology.Publish <T>().TopicDescription, subscriptionName); return(ConnectSubscriptionEndpoint(settings, configure)); }
public ServiceBusSubscriptionEndpointSpecification(IServiceBusHost host, SubscriptionEndpointSettings settings, IServiceBusEndpointConfiguration configuration, ISendTransportProvider sendTransportProvider) : base(host, settings, settings.SubscriptionConfigurator, configuration) { _settings = settings; _configuration = configuration; _sendTransportProvider = sendTransportProvider; }
public ServiceBusSubscriptionEndpointConfiguration(IServiceBusHostConfiguration hostConfiguration, SubscriptionEndpointSettings settings, IServiceBusEndpointConfiguration endpointConfiguration) : base(hostConfiguration, settings, endpointConfiguration) { _hostConfiguration = hostConfiguration; _endpointConfiguration = endpointConfiguration; _settings = settings; HostAddress = hostConfiguration.HostAddress; InputAddress = settings.GetInputAddress(hostConfiguration.HostAddress, settings.Name); }
HostReceiveEndpointHandle CreateSubscriptionEndpoint(Action <IServiceBusSubscriptionEndpointConfigurator> configure, SubscriptionEndpointSettings settings) { var configuration = _hostConfiguration.CreateSubscriptionEndpointConfiguration(settings); configure?.Invoke(configuration.Configurator); BusConfigurationResult.CompileResults(configuration.Validate()); return(_receiveEndpoints.Start(settings.Path)); }
public IServiceBusSubscriptionEndpointConfiguration CreateSubscriptionEndpointConfiguration(string topicPath, string subscriptionName) { if (_hosts.Count == 0) { throw new ConfigurationException("At least one host must be configured"); } var settings = new SubscriptionEndpointSettings(topicPath, subscriptionName); return(_hosts[0].CreateSubscriptionEndpointConfiguration(settings)); }
public ServiceBusSubscriptionEndpointConfiguration(IServiceBusHostConfiguration hostConfiguration, SubscriptionEndpointSettings settings, IServiceBusEndpointConfiguration endpointConfiguration) : base(hostConfiguration, settings, endpointConfiguration) { _hostConfiguration = hostConfiguration; _endpointConfiguration = endpointConfiguration; _settings = settings; HostAddress = hostConfiguration.HostAddress; _inputAddress = new Lazy <Uri>(FormatInputAddress); }
public void CreateSubscriptionEndpoint(SubscriptionEndpointSettings settings, Action <IServiceBusSubscriptionEndpointConfigurator> configure) { var consumePipe = _builder.CreateConsumePipe(); var endpointConfigurator = new ServiceBusSubscriptionEndpointSpecification(_host, settings, consumePipe); configure?.Invoke(endpointConfigurator); BusConfigurationResult.CompileResults(endpointConfigurator.Validate()); endpointConfigurator.Apply(_builder); }
public void CreateSubscriptionEndpoint(SubscriptionEndpointSettings settings, Action<IServiceBusSubscriptionEndpointConfigurator> configure) { var consumePipe = _builder.CreateConsumePipe(); var endpointConfigurator = new ServiceBusSubscriptionEndpointSpecification(_host, settings, consumePipe); configure?.Invoke(endpointConfigurator); BusConfigurationResult.CompileResults(endpointConfigurator.Validate()); endpointConfigurator.Apply(_builder); }
public void CreateSubscriptionEndpoint(SubscriptionEndpointSettings settings, Action <IServiceBusSubscriptionEndpointConfigurator> configure) { var endpointConfiguration = _configuration.CreateNewConfiguration(); var endpointConfigurator = new ServiceBusSubscriptionEndpointSpecification(_host, settings, endpointConfiguration, _sendTransportProvider); configure?.Invoke(endpointConfigurator); BusConfigurationResult.CompileResults(endpointConfigurator.Validate()); endpointConfigurator.Apply(_builder); }
public HostReceiveEndpointHandle ConnectSubscriptionEndpoint <T>(string subscriptionName, Action <IServiceBusSubscriptionEndpointConfigurator> configure = null) where T : class { if (_subscriptionEndpointFactory == null) { throw new ConfigurationException("The subscription endpoint factory was not specified"); } var settings = new SubscriptionEndpointSettings(Topology.Publish <T>().TopicDescription, subscriptionName); _subscriptionEndpointFactory.CreateSubscriptionEndpoint(settings, configure); return(_receiveEndpoints.Start(settings.Path)); }
public Task <HostReceiveEndpointHandle> ConnectSubscriptionEndpoint(string subscriptionName, string topicName, Action <IServiceBusSubscriptionEndpointConfigurator> configure) { if (SubscriptionEndpointFactory == null) { throw new ConfigurationException("The subscription endpoint factory was not specified"); } var settings = new SubscriptionEndpointSettings(topicName, subscriptionName); SubscriptionEndpointFactory.CreateSubscriptionEndpoint(settings, configure); return(_receiveEndpoints.Start(settings.Path)); }
HostReceiveEndpointHandle ConnectSubscriptionEndpoint(SubscriptionEndpointSettings settings, Action <IServiceBusSubscriptionEndpointConfigurator> configure) { LogContext.SetCurrentIfNull(DefaultLogContext); LogContext.Debug?.Log("Connect subscription endpoint: {Topic}/{SubscriptionName}", settings.Path, settings.Name); var configuration = _hostConfiguration.CreateSubscriptionEndpointConfiguration(settings, configure); BusConfigurationResult.CompileResults(configuration.Validate()); configuration.Build(this); return(ReceiveEndpoints.Start(configuration.Settings.Path)); }
public ServiceBusSubscriptionEndpointConfiguration(IServiceBusHostConfiguration hostConfiguration, IServiceBusEndpointConfiguration endpointConfiguration, SubscriptionEndpointSettings settings) : base(hostConfiguration, endpointConfiguration, settings) { _hostConfiguration = hostConfiguration; _endpointConfiguration = endpointConfiguration; _settings = settings; HostAddress = hostConfiguration.Host.Address; InputAddress = new UriBuilder(hostConfiguration.Host.Address) { Path = settings.Name }.Uri; }
HostReceiveEndpointHandle ConnectSubscriptionEndpoint(SubscriptionEndpointSettings settings, Action <IServiceBusSubscriptionEndpointConfigurator> configure) { LogContext.SetCurrentIfNull(DefaultLogContext); var configuration = _hostConfiguration.CreateSubscriptionEndpointConfiguration(settings, configure); TransportLogMessages.ConnectSubscriptionEndpoint(configuration.InputAddress, settings.Name); BusConfigurationResult.CompileResults(configuration.Validate()); configuration.Build(this); return(ReceiveEndpoints.Start(configuration.Settings.Path)); }
public void CreateSubscriptionEndpoint(SubscriptionEndpointSettings settings, Action <IServiceBusSubscriptionEndpointConfigurator> configure) { if (!_configuration.TryGetHost(_host, out var hostConfiguration)) { throw new ConfigurationException("The host was not properly configured"); } var configuration = hostConfiguration.CreateSubscriptionEndpointConfiguration(settings); configure?.Invoke(configuration.Configurator); BusConfigurationResult.CompileResults(configuration.Validate()); configuration.Build(); }
public ServiceBusSubscriptionEndpointSpecification(IServiceBusHost host, SubscriptionEndpointSettings settings, IConsumePipe consumePipe = null) : base(host, settings, consumePipe) { _settings = settings; }
public IServiceBusSubscriptionEndpointConfiguration CreateSubscriptionEndpointConfiguration(SubscriptionEndpointSettings settings) { return(new ServiceBusSubscriptionEndpointConfiguration(this, _busConfiguration.CreateEndpointConfiguration(), settings)); }