This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.22.x by this push:
     new a43e85e1f66 Update HazelcastSedaConsumer.java (#13795)
a43e85e1f66 is described below

commit a43e85e1f66a270796f991f3719ed113240937e9
Author: Krasimir Zhelev <krasimir.zhe...@gmail.com>
AuthorDate: Tue Apr 16 06:24:08 2024 +0200

    Update HazelcastSedaConsumer.java (#13795)
    
    CAMEL-20677: If "transacted" is enabled, the transaction never gets 
committed if body is null. This leads to "Camel Exception cause:  
java.lang.IllegalStateException: Nested transactions are not allowed!".
---
 .../apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
 
b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
index c58db47f288..fb51107c244 100644
--- 
a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
+++ 
b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
@@ -127,6 +127,10 @@ public class HazelcastSedaConsumer extends DefaultConsumer 
implements Runnable {
                             transactionCtx.rollbackTransaction();
                         }
                     }
+                } else {
+                    if (transactionCtx != null) {
+                        transactionCtx.commitTransaction();
+                    }
                 }
             } catch (InterruptedException e) {
                 if (LOG.isDebugEnabled()) {

Reply via email to