in src/main/java/com/googlesource/gerrit/plugins/rabbitmq/session/type/AMQPSession.java [141:164]
public void disconnect() {
logger.atInfo().log(MSG("Disconnecting..."));
try {
if (channel != null) {
logger.atInfo().log(MSG("Closing Channel #%d..."), channel.getChannelNumber());
channel.close();
}
} catch (IOException | TimeoutException ex) {
logger.atSevere().withCause(ex).log(MSG("Error when closing channel."));
} finally {
channel = null;
}
try {
if (connection != null) {
logger.atInfo().log(MSG("Closing Connection..."));
connection.close();
}
} catch (IOException | ShutdownSignalException ex) {
logger.atWarning().withCause(ex).log(MSG("Error when closing connection."));
} finally {
connection = null;
}
}