Beispiel #1
0
        public HostReceiveEndpointHandle ConnectReceiveEndpoint(string queueName, Action <IServiceBusReceiveEndpointConfigurator> configure = null)
        {
            var configuration = _hostConfiguration.CreateReceiveEndpointConfiguration(queueName);

            configure?.Invoke(configuration.Configurator);

            BusConfigurationResult.CompileResults(configuration.Validate());

            configuration.Build();

            return(_receiveEndpoints.Start(queueName));
        }
Beispiel #2
0
        public HostReceiveEndpointHandle ConnectReceiveEndpoint(string queueName, Action <IServiceBusReceiveEndpointConfigurator> configure = null)
        {
            LogContext.SetCurrentIfNull(DefaultLogContext);

            LogContext.Debug?.Log("Connect receive endpoint: {Queue}", queueName);

            var configuration = _hostConfiguration.CreateReceiveEndpointConfiguration(queueName, configure);

            BusConfigurationResult.CompileResults(configuration.Validate());

            configuration.Build(this);

            return(ReceiveEndpoints.Start(configuration.Settings.Path));
        }
Beispiel #3
0
        public HostReceiveEndpointHandle ConnectReceiveEndpoint(string queueName, Action <IServiceBusReceiveEndpointConfigurator> configure = null)
        {
            LogContext.SetCurrentIfNull(DefaultLogContext);

            var configuration = _hostConfiguration.CreateReceiveEndpointConfiguration(queueName, configure);

            BusConfigurationResult.CompileResults(configuration.Validate());

            TransportLogMessages.ConnectReceiveEndpoint(configuration.InputAddress);

            configuration.Build(this);

            return(ReceiveEndpoints.Start(configuration.Settings.Path));
        }
        IBrokeredMessageReceiver CreateBrokeredMessageReceiver(string entityName, Action <IReceiveEndpointConfigurator> configure)
        {
            if (string.IsNullOrWhiteSpace(entityName))
            {
                throw new ArgumentNullException(nameof(entityName));
            }
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            return(_receivers.GetOrAdd(entityName, name =>
            {
                var endpointConfiguration = _hostConfiguration.CreateReceiveEndpointConfiguration(entityName);

                var configurator = new BrokeredMessageReceiverConfiguration(_hostConfiguration, endpointConfiguration);

                configure(configurator);

                return configurator.Build();
            }));
        }