mirror of https://github.com/apache/nifi.git
NIFI-6022 Added try/catch to protect against secondary exception in a primary exception catch clause
NIFI-6022 mods per PR review NIFI-6022 mods per PR review This closes #3476. Signed-off-by: Koji Kawamura <ijokarumawak@apache.org>
This commit is contained in:
parent
de27ab94b0
commit
097b9c3075
|
@ -126,7 +126,12 @@ final class JMSConsumer extends JMSWorker {
|
||||||
// We need to call recover to ensure that in the event of
|
// We need to call recover to ensure that in the event of
|
||||||
// abrupt end or exception the current session will stop message
|
// abrupt end or exception the current session will stop message
|
||||||
// delivery and restart with the oldest unacknowledged message
|
// delivery and restart with the oldest unacknowledged message
|
||||||
session.recover();
|
try {
|
||||||
|
session.recover();
|
||||||
|
} catch (Exception e1) {
|
||||||
|
// likely the session is closed...need to catch this so that the root cause of failure is propagated
|
||||||
|
processLog.debug("Failed to recover JMS session while handling initial error. The recover error is: ", e1);
|
||||||
|
}
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
JmsUtils.closeMessageConsumer(msgConsumer);
|
JmsUtils.closeMessageConsumer(msgConsumer);
|
||||||
|
|
Loading…
Reference in New Issue