Example usage for org.springframework.amqp.rabbit.connection SingleConnectionFactory destroy

List of usage examples for org.springframework.amqp.rabbit.connection SingleConnectionFactory destroy

Introduction

In this page you can find the example usage for org.springframework.amqp.rabbit.connection SingleConnectionFactory destroy.

Prototype

@Override
public final void destroy() 

Source Link

Document

Close the underlying shared connection.

Usage

From source file:org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainerTests.java

@Test
public void testLazyConsumerCount() throws Exception {
    final SingleConnectionFactory singleConnectionFactory = new SingleConnectionFactory("localhost");
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(singleConnectionFactory) {
        @Override//from  ww  w.ja  v a  2s  .com
        protected void doStart() throws Exception {
            // do nothing
        }
    };
    container.start();
    assertEquals(1, ReflectionTestUtils.getField(container, "concurrentConsumers"));
    container.stop();
    singleConnectionFactory.destroy();
}