public FailoverRoundRobin(IConnectionInfo connectionDetails)
        {
            if (!(connectionDetails.BrokerCount > 0))
            {
                throw new ArgumentException("At least one broker details must be specified.");
            }

            _connectionDetails = connectionDetails;

            //There is no current broker at startup so set it to -1.
            _currentBrokerIndex = -1;

            String cycleRetries = _connectionDetails.GetFailoverOption(ConnectionUrlConstants.OPTIONS_FAILOVER_CYCLE);

            if (cycleRetries != null)
            {
                try
                {
                    _cycleRetries = int.Parse(cycleRetries);
                }
                catch (FormatException)
                {
                    _cycleRetries = DEFAULT_CYCLE_RETRIES;
                }
            }

            _currentCycleRetries = 0;

            _serverRetries = 0;
            _currentServerRetry = -1;
        }
        public FailoverRoundRobin(IConnectionInfo connectionDetails)
        {
            if (!(connectionDetails.BrokerCount > 0))
            {
                throw new ArgumentException("At least one broker details must be specified.");
            }

            _connectionDetails = connectionDetails;

            //There is no current broker at startup so set it to -1.
            _currentBrokerIndex = -1;

            String cycleRetries = _connectionDetails.GetFailoverOption(ConnectionUrlConstants.OPTIONS_FAILOVER_CYCLE);

            if (cycleRetries != null)
            {
                try
                {
                    _cycleRetries = int.Parse(cycleRetries);
                }
                catch (FormatException)
                {
                    _cycleRetries = DEFAULT_CYCLE_RETRIES;
                }
            }

            _currentCycleRetries = 0;

            _serverRetries      = 0;
            _currentServerRetry = -1;
        }