Exemplo n.º 1
0
 public static void SetDefaultBusSettings(ServiceBusConfigurator sbc)
 {
     sbc.UseMsmq();
     sbc.VerifyMsmqConfiguration();
     sbc.SetCreateTransactionalQueues(true);
     sbc.UseSubscriptionService(Constants.QueueSubscriptions);
     sbc.UseControlBus();
     sbc.SetDefaultTransactionTimeout(TimeSpan.FromSeconds(20));
     sbc.SetConcurrentConsumerLimit(1);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Configure the control bus, giving the caller the option of adding additional subscriptions to the control bus
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="subscribeCallback"></param>
        /// <returns></returns>
        public ServiceBusConfigurator ConfigureControlBus(ServiceBusConfigurator configurator, Action<SubscriptionBusServiceConfigurator> subscribeCallback)
        {
            // we need a nice, ordered arrival of messages here
            configurator.SetConcurrentConsumerLimit(1);

            configurator.Subscribe(x =>
                {
                    // this is registered as transient because the control bus should not get messages
                    // when it isn't running (and should be a temporary queue as well)
                    x.Consumer(() => new ServiceNodeConsumer(_nodeState.CurrentBehavior))
                        .Transient();
                });

            return configurator;
        }
        /// <summary>
        /// Configure the control bus, giving the caller the option of adding additional subscriptions to the control bus
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="subscribeCallback"></param>
        /// <returns></returns>
        public ServiceBusConfigurator ConfigureControlBus(ServiceBusConfigurator configurator, Action <SubscriptionBusServiceConfigurator> subscribeCallback)
        {
            // we need a nice, ordered arrival of messages here
            configurator.SetConcurrentConsumerLimit(1);

            configurator.Subscribe(x =>
            {
                // this is registered as transient because the control bus should not get messages
                // when it isn't running (and should be a temporary queue as well)
                x.Consumer(() => new ServiceNodeConsumer(_nodeState.CurrentBehavior))
                .Transient();
            });

            return(configurator);
        }
Exemplo n.º 4
0
 protected virtual void ConfigureFaultBus(ServiceBusConfigurator configurator)
 {
     configurator.SetConcurrentConsumerLimit(1);
     configurator.ReceiveFrom(FaultEndpointUri);
     configurator.AddSubscriptionObserver((bus, coordinator) =>
     {
         _localFaultLoopback = new SubscriptionLoopback(bus, coordinator);
         return(_localFaultLoopback);
     });
     configurator.AddSubscriptionObserver((bus, coordinator) =>
     {
         _remoteFaultLoopback = new SubscriptionLoopback(bus, coordinator);
         return(_remoteFaultLoopback);
     });
 }
        void ITransportConfigurator.Configure(ServiceBusConfigurator configurator, string queueName, int? consumerLimit)
        {
            Uri receiveFrom = _settings.GetQueueAddress(queueName, consumerLimit);

            configurator.UseRabbitMq(x =>
                {
                    x.ConfigureHost(receiveFrom, h =>
                        {
                            h.SetUsername(_settings.Username);
                            h.SetPassword(_settings.Password);
                            h.SetRequestedHeartbeat(_settings.Heartbeat);
                        });
                });

            configurator.ReceiveFrom(receiveFrom);
            if (consumerLimit.HasValue)
                configurator.SetConcurrentConsumerLimit(consumerLimit.Value);
        }
        void ITransportConfigurator.Configure(ServiceBusConfigurator configurator, string queueName, int?consumerLimit)
        {
            Uri receiveFrom = _settings.GetQueueAddress(queueName, consumerLimit);

            configurator.UseRabbitMq(x =>
            {
                x.ConfigureHost(receiveFrom, h =>
                {
                    h.SetUsername(_settings.Username);
                    h.SetPassword(_settings.Password);
                    h.SetRequestedHeartbeat(_settings.Heartbeat);
                });
            });

            configurator.ReceiveFrom(receiveFrom);
            if (consumerLimit.HasValue)
            {
                configurator.SetConcurrentConsumerLimit(consumerLimit.Value);
            }
        }
Exemplo n.º 7
0
 public void Configure(ServiceBusConfigurator configurator)
 {
     configurator.SetConcurrentConsumerLimit(1);
 }
 public MassTransitWithAzureServiceBusConfigurator WithConcurrentConsumerLimit(int limit)
 {
     _busConfigurator.SetConcurrentConsumerLimit(limit);
     return(this);
 }
Exemplo n.º 9
0
			public void Configure(ServiceBusConfigurator configurator)
			{
				configurator.SetConcurrentConsumerLimit(1);
			}