slyouts commented on a change in pull request #3476: NIFI-6022 ConsumeJMS - 
Added try/catch to protect against secondary exception in a…
URL: https://github.com/apache/nifi/pull/3476#discussion_r288780237
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSConsumer.java
 ##########
 @@ -126,7 +123,11 @@ public Void doInJms(final Session session) throws 
JMSException {
                     // We need to call recover to ensure that in the event of
                     // abrupt end or exception the current session will stop 
message
                     // delivery and restart with the oldest unacknowledged 
message
-                    session.recover();
+                    try {
+                        session.recover();
+                    } catch (Exception e1) {
+                        // likely the session is closed...just ignore and 
press on with initial problem
+                    }
 
 Review comment:
   I was attempting to use the Apache NiFi code style standards...if I missed 
that mark please let me know.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to