External Task Fetch and Lock Issue

I am using external task client library to fetch tasks from Camunda.If there are no tasks present then API return TASK/CLIENT-02005 Exception exception.

And if there are some new external tasks that gets created still it returns the same exception.And in act_ru_ext_task table i can see tasks are present and it is locked by the same worker and lock time is getting updated after 10 seconds and tasks are not returned.

Tried it from Postman for same workerID as well response is 200 but it returns nothing even if tasks are there or not there.Below is the curl.

curl --location --request POST ‘https://abc.abc.com/rest/external-task/fetchAndLock
–header ‘Content-Type: application/json’
–data-raw ‘{
“workerId”: “anyWorker”,
“maxTasks”: 1,
“asyncResponseTimeout”: 10000,
“topics”: [
{
“topicName”: “abc”,
“lockDuration”: 10000
}
]
}’

When tried same curl on localhost:8080 it worked and returned [] if no tasks and if tasks are present they are returned.

curl --location --request POST ‘http://localhost:8080/rest/external-task/fetchAndLock
–header ‘intuit_tid: a_b_c’
–header ‘Content-Type: application/json’
–data-raw ‘{
“workerId”: “anyWorker”,
“maxTasks”: 1,
“asyncResponseTimeout”: 10000,
“topics”: [
{
“topicName”: “abc”,
“lockDuration”: 10000
}
]
}’

So on Localhost:8080 everything seems working fine but on https it is failing and no records are returned.

Exception while fetch and lock task.

org.camunda.bpm.client.impl.EngineClientException: TASK/CLIENT-02005 Exception while mapping json object to response dto class ‘class [Lorg.camunda.bpm.client.task.impl.ExternalTaskImpl;’
at org.camunda.bpm.client.impl.EngineClientLogger.exceptionWhileMappingJsonObject(EngineClientLogger.java:51)
at org.camunda.bpm.client.impl.RequestExecutor.deserializeResponse(RequestExecutor.java:164)
at org.camunda.bpm.client.impl.RequestExecutor$1.handleEntity(RequestExecutor.java:121)
at org.camunda.bpm.client.impl.RequestExecutor$1.handleResponse(RequestExecutor.java:152)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:223)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140)
at org.camunda.bpm.client.impl.RequestExecutor.executeRequest(RequestExecutor.java:88)
at org.camunda.bpm.client.impl.RequestExecutor.postRequest(RequestExecutor.java:74)
at org.camunda.bpm.client.impl.EngineClient.fetchAndLock(EngineClient.java:78)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.fetchAndLock(TopicSubscriptionManager.java:135)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.acquire(TopicSubscriptionManager.java:101)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.run(TopicSubscriptionManager.java:87)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
at [Source: (org.apache.http.impl.io.EmptyInputStream); line: 1, column: 0]
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4624)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4469)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3471)
at org.camunda.bpm.client.impl.RequestExecutor.deserializeResponse(RequestExecutor.java:160)
… 12 common frames omitted

Hi @Ingo_Richtsmeier can you help ?

Hi @Nishant-sehgal,

sorry, I havn’t worked with an https secured server by myself.

Maybe additionial setting in the client is needed to setup the securitry layer? The engine complains that the body of the request is empty…

Cheers, Ingo

Did you ever manage to resolve this issue?