Example usage for com.rabbitmq.client Connection close

List of usage examples for com.rabbitmq.client Connection close

Introduction

In this page you can find the example usage for com.rabbitmq.client Connection close.

Prototype

void close(int timeout) throws IOException;

Source Link

Document

Close this connection and all its channels with the com.rabbitmq.client.AMQP#REPLY_SUCCESS close code and message 'OK'.

Usage

From source file:org.ballerinalang.messaging.rabbitmq.util.ConnectionUtils.java

License:Open Source License

/**
 * Closes the connection./*  w w w . ja  va  2  s. co  m*/
 *
 * @param connection RabbitMQ Connection object.
 * @param timeout    Timeout (in milliseconds) for completing all the close-related operations, use -1 for infinity.
 * @throws IOException If an I/O problem is encountered.
 */
private static void close(Connection connection, int timeout) throws IOException {
    connection.close(timeout);
}

From source file:uk.ac.sanger.cgp.wwdocker.messages.Messaging.java

License:Open Source License

public void closeRmqConn(Connection conn) {
    try {/*from  www.  jav a 2s .c o  m*/
        conn.close(-1); // 0.5 sec
    } catch (IOException e) {
        throw new RuntimeException(e.toString(), e);
    }
}