Start message event with timer does not return control to Application thread

Hi guys,

I have a process with a start message event followed by some services task and a timer that waits for 3 days.

This process will be called from an external application via Camunda’s REST API /message.

The problem is that, on a success trigger of the said process, Camunda does not return response to external application immediately. Instead, Camunda will takes 3days ( when timer event expires) to respond back to my app.

It looks like the timer as a wait state does not return control back to external app as it should ???

Secondly, Can I mark start message event with asynchronous before (or after ???) To have Camunda immediately return control back to external app ?

Could you guys please help ?
Thank you very much

Yes, you can. Camunda will complete the synchronous processing at the first async point.

1 Like

Hi @ItloMd9,

have you tried the payload parameter "resultEnabled" : true?

Hope this helps, Ingo

@Ingo_Richtsmeier,

Yes, I did. But Camunda still keeps "borrowing my app’s thread until the timer (to wait 3 days).
I also tried not to set value for resultEnabled in the payload. It’s the same.

It finally works with ticking start message event as “async before”.
But I also noticed in some rare cases that an immediate read service task (after start event) arrives at my app before start event returns control back to my app.
Can you guys explain this ?
I can only assume that the 2 threads (main thread and the thread created due to async before) have the same priority

Hi @ItloMd9,

the caller will recieve the result after the process instance reached a wait state and is commited in the database. See this chapter of the docs for background information: https://docs.camunda.org/manual/7.14/user-guide/process-engine/transactions-in-processes/

Maybe an async after on the start event may help you?

Hope this helps, Ingo