You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/10/12 13:04:36 UTC

[GitHub] [camel] davsclaus commented on a diff in pull request #8492: CAMEL-18596: Use async checkpoint updating method from Azure EventCon…

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


##########
components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/EventHubsConsumer.java:
##########
@@ -173,7 +173,12 @@ private void processCommit(final Exchange exchange, final EventContext eventCont
         try {
             var completionCondition = processCheckpoint(exchange);
             if (completionCondition.equals(COMPLETED_BY_SIZE)) {
-                eventContext.updateCheckpoint();
+                eventContext.updateCheckpointAsync()
+                        .subscribe(unused -> LOG.debug("Processed one event..."), error -> {
+                            LOG.debug("Error when updating Checkpoint: {}", error.getMessage());
+                            exchange.setException(error);

Review Comment:
   Since the callback is async then in case of an error, then storing that on the exchange does not make sense as the exchange would likely no longer be in use. Instead the error should be logged, or better yet processed by exception handler on the consumer - there should be a getExceptionHandler.handleException(...) 



-- 
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-unsubscribe@camel.apache.org

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