oscerd commented on code in PR #26778:
URL: https://github.com/apache/camel/pull/26778#discussion_r4090429771
##########
components/camel-pulsar/src/main/java/org/apache/camel/component/pulsar/PulsarConsumer.java:
##########
@@ -136,12 +145,32 @@ public void run() {
// by exiting the loop. We make it explicit instead of
breaking the loop.
running = false;
} else {
- endpoint.getExceptionHandler().handleException(e);
+ getExceptionHandler().handleException("Error consuming
from pulsar", e);
+ running = waitBeforeRetry();
}
} catch (Exception e) {
- endpoint.getExceptionHandler().handleException(e);
+ getExceptionHandler().handleException("Error consuming
from pulsar", e);
+ running = waitBeforeRetry();
}
}
}
+
+ /**
+ * Waits before polling again, so that a failure which does not clear
- an unreachable broker, a consumer in
+ * Failed state - does not turn this into a hot loop on every consumer
thread, reporting the same error to the
+ * exception handler as fast as the CPU allows.
+ *
+ * @return <tt>false</tt> when the wait was interrupted, which is how
a stopping consumer leaves the loop
Review Comment:
Applied. I checked the convention first rather than taking it on faith:
repo-wide it is 1702 files using `{@code }` against 837 still on `<tt>`, and
camel-pulsar had neither, so `{@code}` is the right side to land on.
I made the same change on #26779, which had three `<tt>` tags from the same
habit — no point collecting the nit twice.
_Claude Code on behalf of oscerd_
--
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]