List of usage examples for org.springframework.amqp.rabbit.core RabbitAdmin declareQueue
@Override @ManagedOperation(description = "Declare a queue with a broker-generated name (this operation is not available remotely)") @Nullable public Queue declareQueue()
From source file:org.springframework.amqp.rabbit.core.RabbitAdminTests.java
@Test public void testFailOnFirstUseWithMissingBroker() throws Exception { SingleConnectionFactory connectionFactory = new SingleConnectionFactory("localhost"); connectionFactory.setPort(434343);// www.j av a 2 s . co m GenericApplicationContext applicationContext = new GenericApplicationContext(); applicationContext.getBeanFactory().registerSingleton("foo", new Queue("queue")); RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory); rabbitAdmin.setApplicationContext(applicationContext); rabbitAdmin.setAutoStartup(true); rabbitAdmin.afterPropertiesSet(); exception.expect(IllegalArgumentException.class); rabbitAdmin.declareQueue(); connectionFactory.destroy(); }