Esempio n. 1
0
 /// <summary>
 /// Clones channel queue options from another options
 /// </summary>
 internal static ChannelQueueOptions CloneFrom(ChannelQueueOptions options)
 {
     return(new ChannelQueueOptions
     {
         Status = options.Status,
         AcknowledgeTimeout = options.AcknowledgeTimeout,
         MessageTimeout = options.MessageTimeout,
         RequestAcknowledge = options.RequestAcknowledge,
         HideClientNames = options.HideClientNames,
         UseMessageId = options.UseMessageId,
         WaitForAcknowledge = options.WaitForAcknowledge,
         SendOnlyFirstAcquirer = options.SendOnlyFirstAcquirer,
         MessageLimit = options.MessageLimit
     });
 }
Esempio n. 2
0
        private ChannelQueueOptions CloneFromAsQueue(ChannelQueueOptions other)
        {
            ChannelQueueOptions options = new ChannelQueueOptions();

            options.AcknowledgeTimeout    = other.AcknowledgeTimeout;
            options.Status                = other.Status;
            options.RequestAcknowledge    = other.RequestAcknowledge;
            options.WaitForAcknowledge    = other.WaitForAcknowledge;
            options.HideClientNames       = other.HideClientNames;
            options.MessageTimeout        = other.MessageTimeout;
            options.UseMessageId          = other.UseMessageId;
            options.SendOnlyFirstAcquirer = other.SendOnlyFirstAcquirer;
            options.MessageLimit          = other.MessageLimit;

            return(options);
        }
Esempio n. 3
0
        private void SetQueuePropertyValues(JToken from, ChannelQueueOptions options)
        {
            JToken messageQueuing = from["Status"];

            if (messageQueuing != null)
            {
                string status = messageQueuing.Value <string>().ToLower();
                switch (status)
                {
                case "route":
                    options.Status = QueueStatus.Route;
                    break;

                case "push":
                    options.Status = QueueStatus.Push;
                    break;

                case "pull":
                    options.Status = QueueStatus.Pull;
                    break;

                case "rr":
                case "round":
                case "robin":
                case "roundrobin":
                case "round-robin":
                    options.Status = QueueStatus.RoundRobin;
                    break;

                case "pause":
                case "paused":
                    options.Status = QueueStatus.Paused;
                    break;

                case "stop":
                case "stoped":
                case "stopped":
                    options.Status = QueueStatus.Stopped;
                    break;
                }
            }

            JToken sendOnlyFirstAcquirer = from["SendOnlyFirstAcquirer"];

            if (sendOnlyFirstAcquirer != null)
            {
                options.SendOnlyFirstAcquirer = sendOnlyFirstAcquirer.Value <bool>();
            }

            JToken requestAcknowledge = from["RequestAcknowledge"];

            if (requestAcknowledge != null)
            {
                options.RequestAcknowledge = requestAcknowledge.Value <bool>();
            }

            JToken acknowledgeTimeout = from["AcknowledgeTimeout"];

            if (acknowledgeTimeout != null)
            {
                options.AcknowledgeTimeout = TimeSpan.FromMilliseconds(acknowledgeTimeout.Value <int>());
            }

            JToken messagePendingTimeout = from["MessagePendingTimeout"];

            if (messagePendingTimeout != null)
            {
                options.MessageTimeout = TimeSpan.FromMilliseconds(messagePendingTimeout.Value <int>());
            }

            JToken useMessageId = from["UseMessageId"];

            if (useMessageId != null)
            {
                options.UseMessageId = useMessageId.Value <bool>();
            }

            JToken waitAcknowledge = from["WaitAcknowledge"];

            if (waitAcknowledge != null)
            {
                options.WaitForAcknowledge = waitAcknowledge.Value <bool>();
            }

            JToken hideClientNames = from["HideClientNames"];

            if (hideClientNames != null)
            {
                options.HideClientNames = hideClientNames.Value <bool>();
            }
        }