fapaul commented on a change in pull request #16333:
URL: https://github.com/apache/flink/pull/16333#discussion_r663754380
##########
File path:
flink-connectors/flink-connector-rabbitmq/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/RMQSource.java
##########
@@ -273,44 +276,56 @@ public void open(Configuration config) throws Exception {
@Override
public void close() throws Exception {
super.close();
+ Exception exception = null;
try {
if (consumer != null && channel != null) {
channel.basicCancel(consumer.getConsumerTag());
}
} catch (IOException e) {
- throw new RuntimeException(
- "Error while cancelling RMQ consumer on "
- + queueName
- + " at "
- + rmqConnectionConfig.getHost(),
- e);
+ exception =
+ new RuntimeException(
+ "Error while cancelling RMQ consumer on "
+ + queueName
+ + " at "
+ + rmqConnectionConfig.getHost(),
+ e);
}
try {
if (channel != null) {
channel.close();
}
} catch (IOException e) {
- throw new RuntimeException(
- "Error while closing RMQ channel with "
- + queueName
- + " at "
- + rmqConnectionConfig.getHost(),
- e);
+ exception =
+ ExceptionUtils.firstOrSuppressed(
+ new RuntimeException(
+ "Error while closing RMQ channel with "
+ + queueName
+ + " at "
+ + rmqConnectionConfig.getHost(),
+ e),
Review comment:
Yes, please also create the backports.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]