return queue;
}
private AMQConnection createConnectionWithFailover() throws NamingException, JMSException, URLSyntaxException
{
BrokerDetails origBrokerDetails = ((AMQConnectionFactory) getConnectionFactory("default")).getConnectionURL().getBrokerDetails(0);
String retries = "200";
String connectdelay = "1000";
String cycleCount = "2";
String newUrlFormat="amqp://username:password@clientid/test?brokerlist=" +
"'tcp://%s:%s?retries='%s'&connectdelay='%s''&failover='singlebroker?cyclecount='%s''";
String newUrl = String.format(newUrlFormat, origBrokerDetails.getHost(), origBrokerDetails.getPort(),
retries, connectdelay, cycleCount);
ConnectionFactory connectionFactory = new AMQConnectionFactory(newUrl);
AMQConnection connection = (AMQConnection) connectionFactory.createConnection("admin", "admin");
connection.setConnectionListener(this);