gnodet-bot commented on code in PR #27918:
URL: https://github.com/apache/camel/pull/27918#discussion_r4291286993


##########
components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoAbstractConsumerThread.java:
##########
@@ -99,8 +99,20 @@ protected boolean processExchange(Exchange exchange) {
     public void run() {
         stoppedLatch = new CountDownLatch(1);
         try {
-            while (keepRunning) {
+            // an interrupt ends the thread, as it did before the cursor was 
reopened inside the try
+            while (keepRunning && !Thread.currentThread().isInterrupted()) {
                 try {
+                    if (cursor == null) {
+                        // a new cursor after the previous one ended. It is 
opened here, inside the try, so that a
+                        // failure to open it (the server cannot be reached 
yet) is reported and tried again after
+                        // the delay, instead of ending this thread while the 
consumer stays started

Review Comment:
   ⚠️ **Log volume concern (low severity):** `initializeCursor()` is now inside 
the inner `try` block, so permanent MongoDB failures will log a WARN with full 
stack trace on every `cursorRegenerationDelay` cycle. Consider rate-limiting: 
e.g. always log the first failure, then every Nth retry only.



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