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:40 UTC

(camel) 02/15: CAMEL-20189: camel-minio: Force marking the consumer ready sooner, in case downloading a big file 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 f800b8887a354284ca8cb579262636adfb80cf30
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Dec 7 09:53:16 2023 +0100

    CAMEL-20189: camel-minio: Force marking the consumer ready sooner, in case downloading a big file takes too long, causing readiness check to timeout and fail.
---
 .../src/main/java/org/apache/camel/component/minio/MinioConsumer.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java b/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java
index 49647d77814..deaf5e4eda8 100644
--- a/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java
+++ b/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioConsumer.java
@@ -166,6 +166,9 @@ public class MinioConsumer extends ScheduledBatchPollingConsumer {
 
             Iterator<Result<Item>> listObjects = getMinioClient().listObjects(listObjectRequest.build()).iterator();
 
+            // we have listed some objects so mark the consumer as ready
+            forceConsumerAsReady();
+
             if (listObjects.hasNext()) {
                 exchanges = createExchanges(listObjects);
                 if (maxMessagesPerPoll <= 0 || exchanges.size() < maxMessagesPerPoll) {
@@ -224,7 +227,6 @@ public class MinioConsumer extends ScheduledBatchPollingConsumer {
         } catch (Exception e) {
             LOG.warn("Error getting MinioObject due: {}", e.getMessage());
             throw e;
-
         }
 
         return answer;