...
In this code we create a query to Camunda runtime to find process waiting for message "sdncAdapterCallbackRequest" with variable "SDNCA_requestId" set to value of requestID
If we don't find any process the code wait 1 minute to find a process (with sleep code..)
The problem
If the time between the call back and the "catch event" step is more than one minute we fail... and we need to wait the timeout (5 minutes) to exit the "Wait for asynchronous message" step.
The callBack request is synchronous, so in case of 1 minute timeout, the client are wating a long time... it's not a good point (imagine we have a proxy between SDNC and SO with a 30s timeout...)
One solution
Start listening for event earlier. I will also check error management on SDNC