Hello
We have a problem with the correlation of messages. Most of the time the correlation works as expected but randomly it fails. Using Camunda 7.15.0, Spring Boot 2.4.11.
We have a simple process called customer-fetchercustomer-fetcher.bpmn (3.3 KB)
The process is used in another process via a call activity.
It calls a rest to an external service in getCustomerFromShopAdapter and then it should wait until we receive a message back. The message is usually received after 2-3 seconds from the external service and then we use the following code to correlate the message to an existing process instance. (messageType=ackGetCustomer)
camunda.getRuntimeService().createMessageCorrelation(message.getMessageType())
.processInstanceBusinessKey(message.getTraceId())
.setVariable(CustomerFetcherProcessConstants.VAR_CUSTOMER_SEARCH_RESPONSE, customerSearchResponse)
.correlate();
Even if there is one process instance waiting for the ackGetCustomer we get an org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message ‘ackGetCustomer’: No process definition or execution matches the parameters exception and the process instance is still at the waiting point as in the attached image
If the external service resends the same message and we retry to correlate (going through the exactly same process) it works without problems.
Most of the times the correlation succeeds from the first try and sometimes it fails. We are not able to reproduce the issue as it seems to appear randomly.
What can be the issue?