External Task connects repeatedly when camunda restarted

When Camunda is Restarted , External Tasks repeatedly tries to connect to Camunda Server and report exception logs below even camunda is started. I have to restart External Task application as well.

TASK/CLIENT-03001 Exception while fetch and lock task.
org.camunda.bpm.client.impl.EngineClientException: TASK/CLIENT-02002 Exception while establishing connection for request ‘POST http://localhost:8080/engine-rest/external-task/fetchAndLock HTTP/1.1’

I have tried below options
Option1: Disabling autofetching is solving it but Service tasks are not working by disabling this field
ExternalTaskClient.create()
.baseUrl(camundaUrl)
.maxTasks(1)
.asyncResponseTimeout(delayTimeOut)
.disableAutoFetching()
.build();
Option2: Disabling backoffstrategy does not works

ExternalTaskClient.create()
.baseUrl(camundaUrl)
.maxTasks(1)
.asyncResponseTimeout(delayTimeOut)
.backoffStrategy(new ExponentialBackoffStrategy(0, 0, 0))
.disableBackoffStrategy()
.build();
Any solution for this? Without restarting my application if Camunda restarted?

1 Like