public void ApplyGlobalOptions(GlobalConsumerOptions globalConsumerOptions) { NoLocal = globalConsumerOptions.NoLocal ?? NoLocal; Exclusive = globalConsumerOptions.Exclusive ?? Exclusive; BatchSize = globalConsumerOptions.BatchSize ?? BatchSize; AutoAck = globalConsumerOptions.AutoAck ?? AutoAck; UseTransientChannels = globalConsumerOptions.UseTransientChannels ?? UseTransientChannels; ErrorSuffix = globalConsumerOptions.ErrorSuffix ?? ErrorSuffix; BehaviorWhenFull = globalConsumerOptions.BehaviorWhenFull ?? BehaviorWhenFull; if (globalConsumerOptions.GlobalConsumerPipelineOptions != null) { if (ConsumerPipelineOptions == null) { ConsumerPipelineOptions = new ConsumerPipelineOptions(); } ConsumerPipelineOptions.WaitForCompletion = globalConsumerOptions.GlobalConsumerPipelineOptions.WaitForCompletion ?? ConsumerPipelineOptions.WaitForCompletion; ConsumerPipelineOptions.MaxDegreesOfParallelism = globalConsumerOptions.GlobalConsumerPipelineOptions.MaxDegreesOfParallelism ?? ConsumerPipelineOptions.MaxDegreesOfParallelism; ConsumerPipelineOptions.EnsureOrdered = globalConsumerOptions.GlobalConsumerPipelineOptions.EnsureOrdered ?? ConsumerPipelineOptions.EnsureOrdered; } }
public void ApplyGlobalConsumerOptions() { foreach (var kvp in ConsumerOptions) { // Apply the global consumer settings and global consumer pipeline settings // on top of (overriding) individual consumer settings. Opt out by not setting // the global settings field. if (!string.IsNullOrWhiteSpace(kvp.Value.GlobalSettings) && GlobalConsumerOptions.ContainsKey(kvp.Value.GlobalSettings)) { kvp.Value.ApplyGlobalOptions(GlobalConsumerOptions[kvp.Value.GlobalSettings]); } } }