public void ValidateQpidConnectionInfoFromToString() { String url = "amqp://*****:*****@default/temp?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'"; IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(url); IConnectionInfo connectionInfo1 = QpidConnectionInfo.FromUrl(connectionInfo.ToString()); Console.WriteLine(connectionInfo.ToString()); Console.WriteLine(connectionInfo1.ToString()); Assert.AreEqual(connectionInfo.Username, connectionInfo1.Username); Assert.AreEqual(connectionInfo.Password, connectionInfo1.Password); Assert.AreEqual(connectionInfo.VirtualHost, connectionInfo1.VirtualHost); Assert.IsTrue((connectionInfo1.GetAllBrokerInfos().Count == 2)); Assert.IsTrue(connectionInfo.GetBrokerInfo(0).Equals(connectionInfo1.GetBrokerInfo(0))); Assert.IsTrue(connectionInfo.GetBrokerInfo(1).Equals(connectionInfo1.GetBrokerInfo(1))); }
public void SetBroker(IBrokerInfo broker) { _connectionDetails.AddBrokerInfo(broker); int index = _connectionDetails.GetAllBrokerInfos().IndexOf(broker); String serverRetries = broker.GetOption(BrokerInfoConstants.OPTIONS_RETRY); if (serverRetries != null) { try { _serverRetries = int.Parse(serverRetries); } catch (FormatException) { _serverRetries = DEFAULT_SERVER_RETRIES; } } _currentServerRetry = -1; _currentBrokerIndex = index; }