allthingssecurity commented on code in PR #30816:
URL: https://github.com/apache/camel/pull/30816#discussion_r4703768586


##########
components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java:
##########
@@ -102,6 +118,11 @@ public void run() {
 
         while (queue != null && isRunAllowed()) {
             final boolean transacted = 
endpoint.getConfiguration().isTransacted();
+            if (transacted && !beginTransacted()) {
+                // the consumer is stopping
+                break;
+            }
+            boolean errorDelay = false;
             // the transacted consumer reads the outcome of the exchange after 
the routing is done, so it releases the
             // exchange itself: a pooled exchange is otherwise reset (and its 
exception cleared) when it is done
             final Exchange exchange = createExchange(!transacted);

Review Comment:
   Done in 6a87938f76a8, a bit differently: the thread now creates its exchange 
before beginTransacted(), and releases it when the consumer is stopping, so a 
failure in createExchange() happens before the thread is counted and no 
try/catch is needed. HazelcastSedaTransactedStopTest has a new test that fails 
the creation of the exchange once and checks that the stop does not wait for 
the thread (it took the full 6 s shutdown timeout before).



-- 
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]

Reply via email to