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

[jira] [Updated] (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:all-tabpanel ]

Jani Yli-Paavola updated CAMEL-18596:
-------------------------------------
    Description: 
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)

  was:
EventHubsConsumer is calling a blocking method from Azure EventContext when updating a CheckPoint.


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

And corresponding method in Azure EventContext:
{code:java}
 public void updateCheckpoint() {
        this.updateCheckpointAsync().block();
    }
{code}

I suppose processCommit method should invoke Async method and subscribe to it.


> 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: Bug
>          Components: camel-azure-eventhubs
>            Reporter: Jani Yli-Paavola
>            Priority: Critical
>
> 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)