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


##########
core/camel-core-model/src/main/java/org/apache/camel/model/ResumableDefinition.java:
##########
@@ -40,6 +40,11 @@
     @Metadata(required = true, javaType = "org.apache.camel.ResumeStrategy")
     private String resumeStrategy;
 
+    @XmlAttribute(required = true)

Review Comment:
   I do not think this should be required = true, as the default value is ERROR
   
   (PS later you use WARN as the default in the resolveLogger)



##########
core/camel-core-reifier/src/main/java/org/apache/camel/reifier/ResumableReifier.java:
##########
@@ -47,6 +49,17 @@ protected ResumeStrategy resolveResumeStrategy() {
             String ref = parseString(definition.getResumeStrategy());
             strategy = mandatoryLookup(ref, ResumeStrategy.class);
         }
+
         return strategy;
     }
+
+    protected LoggingLevel resolveLoggingLevel() {
+        LoggingLevel loggingLevel = parse(LoggingLevel.class, 
definition.getLoggingLevel());
+
+        if (loggingLevel == null) {
+            loggingLevel = LoggingLevel.WARN;

Review Comment:
   Here default value is WARN but in the model it is ERROR.
   



##########
core/camel-core-processor/src/main/java/org/apache/camel/processor/resume/ResumableCompletion.java:
##########
@@ -70,6 +73,29 @@ 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;
+
+            if (loggingLevel == LoggingLevel.DEBUG && LOG.isDebugEnabled()) {

Review Comment:
   This would only make logging level work for DEBUG and any other value will 
log is hardcoded to log at WARN in the else block.
   
   Take a look at CamelLogger class which can log at configured level 
automatic, so you can use call its log method.



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