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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]