How can I ignore the Mismatching Message Correlation Exception in process

I have a process that send message to another process. There are a situation that receiver process is not available and I want to ignore this. I use intermediate error catch event but after catching I give
org.springframework.transaction.UnexpectedRollbackException: Transaction silently rolled back because it has been marked as rollback-only.
Before adding intermediate error catch event I give org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message 'mesageReceiver': No process definition or execution matches the parameters.

Is there any solution for ignoring MismatchingMessageCorrelationException?
Is there any API for finding receive message name?
counter-process.bpmn (5.0 KB)
is my bpmn file.

1 Like

Hi @Mohammad_Mahdavi,

you use the following expression to correlate the message:

${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation(execution.getVariable("responseMessageName")) .setVariable("result", "12") .correlateWithResult()}

If you use correlateAll() instead of correlateWithResult() then no exception is thrown.

Does this help you?

Best regards,
Philipp

3 Likes

Hi @Philipp_Ossler ,

Thanks much for this solution . We are getting mismatch correlation error when we resume the message in the receive task from Kafka . We tried your solution and its working perfectly , Kindly let us know what is the difference between corelate and corelateAll . Thanks in advance.