NServiceBus.MessageProcessingOptimizationExtensions.LimitMessageProcessingConcurrencyTo C# (CSharp) Method

LimitMessageProcessingConcurrencyTo() public static method

Instructs the transport to limits the allowed concurrency when processing messages.
public static LimitMessageProcessingConcurrencyTo ( this config, int maxConcurrency ) : void
config this The instance to apply the settings to.
maxConcurrency int The max concurrency allowed.
return void
        public static void LimitMessageProcessingConcurrencyTo(this EndpointConfiguration config, int maxConcurrency)
        {
            Guard.AgainstNull(nameof(config), config);
            Guard.AgainstNegativeAndZero(nameof(maxConcurrency), maxConcurrency);

            config.Settings.Set<ConcurrencyLimit>(new ConcurrencyLimit
            {
                MaxValue = maxConcurrency
            });
        }
MessageProcessingOptimizationExtensions