Setting the timing parameters for external task clients

Hi @ujay68,

I went through the same questions as you and provided some pull requests to the docs for clarification. For example https://docs.camunda.org/manual/develop/user-guide/ext-client/#external-task-throughput

You should activate the long polling with a asyncResponseTimeout of maybe two minutes (value 120000) and decrease the backoff to 0. Then the client will look for a new task immediately after the last one is completed.

You should get as many tasks per fetch as you expect to be there and to be completed in one fetch. The external task client starts the handlers sequentially.

The lockDuration should be the longest expected completion time.

Maybe this setup helps you:

    ExternalTaskClient client = ExternalTaskClient.create()
      .baseUrl("http://localhost:8080/engine-rest")
      .workerId("Playground-Worker")
      .maxTasks(1)
      .asyncResponseTimeout(120000)
      .backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0))
      .build();

It helped me a lot to configure the logging of the http client with this maven dependency:

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <version>1.7.25</version>
    </dependency>

and this log levels:

  <logger name="org.apache.http.wire" level="debug" additivity="false">
    <appender-ref ref="STDOUT" />
  </logger>

Cheers, Ingo

1 Like