in flink-connector-rabbitmq/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/RMQSink.java [238:268]
public void close() {
Exception t = null;
try {
if (channel != null) {
channel.close();
}
} catch (IOException | TimeoutException e) {
t = e;
}
try {
if (connection != null) {
connection.close();
}
} catch (IOException e) {
if (t != null) {
LOG.warn(
"Both channel and connection closing failed. Logging channel exception and failing with connection exception",
t);
}
t = e;
}
if (t != null) {
throw new RuntimeException(
"Error while closing RMQ connection with "
+ queueName
+ " at "
+ rmqConnectionConfig.getHost(),
t);
}
}