You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2022/10/15 08:00:00 UTC

[jira] [Commented] (CAMEL-18596) camel-azure-eventhubs consumer is invoking a blocking method

    [ https://issues.apache.org/jira/browse/CAMEL-18596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17618035#comment-17618035 ] 

Claus Ibsen commented on CAMEL-18596:
-------------------------------------

Thanks for reporting and the PR

> camel-azure-eventhubs consumer is invoking a blocking method
> ------------------------------------------------------------
>
>                 Key: CAMEL-18596
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18596
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-azure-eventhubs
>            Reporter: Jani Yli-Paavola
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.20.0
>
>
> EventHubsConsumer and EventHubsCheckpointUpdaterTimerTask are calling a blocking method from Azure EventContext when updating a CheckPoint.
> In EventHubsConsumer:
> {code:java}
> private void processCommit(final Exchange exchange, final EventContext eventContext) {
> ...
>    try {
>       var completionCondition = processCheckpoint(exchange);
>       if (completionCondition.equals(COMPLETED_BY_SIZE)) {
>           eventContext.updateCheckpoint();   <-- HERE
>           processedEvents.set(0);
>         ...
> } {code}
> In EventHubsCheckpointUpdaterTimerTaks
> {code:java}
> @Override
> public void run() {
>     if (processedEvents.get() > 0) {
>   ...
>         eventContext.updateCheckpoint();   <-- HERE
>         processedEvents.set(0);
>     } 
>   ...
> } {code}
> And corresponding method in Azure EventContext:
> {code:java}
>  public void updateCheckpoint() {
>         this.updateCheckpointAsync().block();
>     }
> {code}
> I suppose EventContext's async update method should be invoked (and subscribed)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)