You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/12/07 10:09:47 UTC

(camel) 09/15: CAMEL-20189: camel-jsql and camel-mybatis: Force marking the consumer ready sooner, in case processing exchanges takes too long, causing readiness check to timeout and fail.

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

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

commit 7f0f82d962f249c00b4a354fff7164a71ede345c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Dec 7 10:48:17 2023 +0100

    CAMEL-20189: camel-jsql and camel-mybatis: Force marking the consumer ready sooner, in case processing exchanges takes too long, causing readiness check to timeout and fail.
---
 .../main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java  | 3 +++
 .../src/main/java/org/apache/camel/component/sql/SqlConsumer.java      | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java
index 237c175262d..6bf0e4e35a3 100644
--- a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java
+++ b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisConsumer.java
@@ -78,6 +78,9 @@ public class MyBatisConsumer extends ScheduledBatchPollingConsumer {
         LOG.trace("Polling: {}", endpoint);
         List<?> data = endpoint.getProcessingStrategy().poll(this, getEndpoint());
 
+        // okay we have some response from MyBatis so lets mark the consumer as ready
+        forceConsumerAsReady();
+
         // create a list of exchange objects with the data
         Queue<DataHolder> answer = new LinkedList<>();
         if (useIterator) {
diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlConsumer.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlConsumer.java
index 81ad935080b..bf18b64d4bc 100644
--- a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlConsumer.java
+++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlConsumer.java
@@ -178,6 +178,9 @@ public class SqlConsumer extends ScheduledBatchPollingConsumer {
                     }
                 }
 
+                // okay we have some response from SQL so lets mark the consumer as ready
+                forceConsumerAsReady();
+
                 // process all the exchanges in this batch
                 try {
                     if (answer.isEmpty()) {