orpiske commented on code in PR #7392:
URL: https://github.com/apache/camel/pull/7392#discussion_r847229348


##########
core/camel-core-processor/src/main/java/org/apache/camel/processor/resume/ResumableCompletion.java:
##########
@@ -70,6 +74,34 @@ public void onComplete(Exchange exchange) {
 
     @Override
     public void onFailure(Exchange exchange) {
-        LOG.warn("Skipping offset update for due to failure in processing");
+        Exception e = exchange.getException();
+        Object offset = exchange.getMessage().getHeader(Exchange.OFFSET);
+
+        if (offset instanceof Resumable) {
+            Resumable<?, ?> resumable = (Resumable<?, ?>) offset;
+
+            String logMessage = String.format(
+                    "Skipping offset update with address '%s' and offset value 
'%s' due to failure in processing: %s",
+                    resumable.getAddressable(), 
resumable.getLastOffset().offset(), e.getMessage());
+
+            if (LOG.isDebugEnabled()) {
+                CamelLogger.log(LOG, loggingLevel, logMessage, e);

Review Comment:
   So, I if I understand it correctly. I should do something like:
   
   ```
   if (LOG.isDebugEnabled() || CamelLogger.shouldLog(LoggingLevel.DEBUG)) {
   ```



-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to