ayyappa maddi
ayyappa maddi

Reputation: 961

Camunda External tasks messages are de prioritising

We use node camunda-external-task-client-js to handle camunda external tasks. Following is the client configuration

"topic_name": "app-ext-task",
"maxTasks": 5,
"maxParallelExecutions": 5,
"interval": 500,
"usePriority": true,
"lockDuration":2100000,
"workerId": "app-ext-task-worker"

We are getting external task details and able to processing them,But some times we see some tasks are getting deprioritised.

We are not setting any priority to any external task, by default all tasks are assigned priority 0.

We expect all tasks will execute in sequential manner, we agree some tasks may take more time than the subsequent task so that the taks-1 may take more time than task-2.

Ex: If a queue contains 10 taks [task1,taks-2,task-3,task-4,task-5,...task-10] All the tasks executed sequentially as all the tasks have same priority. 1st:task-1, 2nd:task-2 3rd: task-3

Problem: We see some tasks are getting deprioritised it means early messages are taking priority over existing messages.

1st:task-1,

2nd:task-2

3rd: task-4

4th: task-5

5th: task-6

6th: task-7

7th: task-8

8th: task-3

I am seeing problem at 2 places

  1. While producing the message, camunda could have not posted the message in QUEUE.
  2. While reading the Queue camunda external tasks are not processed properly.

I didn't find much docs on this, I don't know how do I debug this. For me this is an intermitent issue, as I am not able to find the root cause of the problem.

I am not sure how to debug this as well.

Is my expectation wrong in camunda queues?

Upvotes: 0

Views: 319

Answers (1)

Jan Galinski
Jan Galinski

Reputation: 12013

The external tasks do not form a "queue". They are instances in a pool of possible tasks, your worker fetches "some" tasks, which might be in order or not. You could prioritise the tasks, but still, if you have 10 "highest" prio tasks in the pool and the worker fetches 5, you won't be able to determine which are chosen.

But you have a process engine at hand, if keeping the sequence is essential for your process, why do you start all tasks at once and rely on the external worker to keep the order? Why not just creating one task at a time and continue when it is finished?

Upvotes: 1

Related Questions