private Channel createQueues(Connection connection) throws IOException, MalformedURLException, URISyntaxException { Channel channel; channel = connection.createChannel(); for (String queueName : this.queues) { if (this.purge) { logger.debug("Deleting queue: " + queueName); // Delete completely - gets rid of consumers and bindings as well channel.queueDelete(queueName); } if (isDefaultQueue(queueName)) { // Just for test probe. channel.queueDelete(queueName); } else { channel.queueDeclare(queueName, true, false, false, null); } } brokerOffline.put(this.port, false); if (!this.assumeOnline) { Assume.assumeTrue(brokerOffline.get(this.port)); } if (this.management) { Client client = new Client(getAdminUri(), this.adminUser, this.adminPassword); if (!client.alivenessTest("/")) { throw new BrokerNotAliveException("Aliveness test failed for localhost:15672 guest/quest; " + "management not available"); } } return channel; }
private Channel createQueues(Connection connection) throws IOException, MalformedURLException, URISyntaxException { Channel channel; channel = connection.createChannel(); for (String queueName : this.queues) { if (this.purge) { logger.debug("Deleting queue: " + queueName); // Delete completely - gets rid of consumers and bindings as well channel.queueDelete(queueName); } if (isDefaultQueue(queueName)) { // Just for test probe. channel.queueDelete(queueName); } else { channel.queueDeclare(queueName, true, false, false, null); } } brokerOffline.put(this.port, false); if (!this.assumeOnline) { Assume.assumeTrue(brokerOffline.get(this.port)); } if (this.management) { Client client = new Client(getAdminUri(), this.adminUser, this.adminPassword); if (!client.alivenessTest("/")) { throw new BrokerNotAliveException("Aliveness test failed for localhost:15672 guest/quest; " + "management not available"); } } return channel; }