예제 #1
0
        public void SetQueueArgument(string key, object value)
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            if (value == null)
            {
                QueueArguments.Remove(key);
            }
            else
            {
                QueueArguments[key] = value;
            }
        }
예제 #2
0
        public void SetQuorumQueue(int?replicationFactor)
        {
            SetQueueArgument(Headers.XQueueType, "quorum");
            Durable   = true;
            Exclusive = false;

            QueueArguments.Remove(Headers.XMaxPriority);

            if (replicationFactor.HasValue)
            {
                if (replicationFactor.Value < 1)
                {
                    throw new ArgumentOutOfRangeException(nameof(replicationFactor), "Must be greater than zero and less than or equal to the cluster size.");
                }

                SetQueueArgument(Headers.XQuorumInitialGroupSize, replicationFactor.Value);
            }
        }