Getting error "Cannot correlate a message with name" when Camunda service restarts

startBusinessFlow BPMN

  • This BPMN help us in initiating businessFlow.

businessFlow BPMN

  • this flow gets initiated by startBusinessFlow via inline script.
  • And whenever server sends WORK_IN_PROGRESS msg we need to create another businessFlow and for that we send MSG_3 to startBusinessFlow.
    We send MSG_3 using this

try {
execution.getProcessEngineServices().getRuntimeService().correlateMessage(“MSG_3”, execution.getVariable(‘startFlowBusinessKey’));
} catch(err) {
java.lang.System.out.println(err);
}

Problem
Everything works perfectly fine but when camunda service gets restarted, I get this error “Cannot correlate a message with name MSG_3”.

Hi,

How do you deploy your process models - are these deployed via the modeller or REST API? If so, and the engine is set to deployment aware, then on resstart, the engine may not recognise these deployments any more and thus it wont correlate messages.

Hence - confirm the way you deploy your process models and if approrpiate change engine config deployment aware to false and see if that resolves your issue…

regards

Rob

@Webcyberrob Thanks you so much for the response.

I am doing deployment with Camunda Modeler as well as REST API. and Camunda engine is running using Docker Image provided by Camunda.

I cannot see deployment aware option in REST API as well as Camunda Modeler. can you please guide, How to check and change these config?

@AnuragJain deployment aware property is process engine configuration.

You can configure it in application.yml file like this:

camunda:
  bpm:
    enabled: true
    job-execution:
      enabled: true
      deployment-aware: true

This article suggested that deployment aware setting should always be true.

…In addition, make sure you set camunda.bpm.job-execution.deployment-aware engine property to true. This way each engine will be responsible of executing the jobs related to their own engine, registered process and therefore have access to the Java classes associated to such execution. Otherwise any engine could try to pick up the process where it left off (so called jobs) and run into class not found issues. …

@Webcyberrob, @aravindhrs is it good idea to set deployment-aware false ?

Deployment-aware property is used in camunda heterogeneous cluster setup. Refer this camundacon presentation:

if I set deployment-aware setting to false, I won’t be able to run camunda on multiple nodes.

So, is there any other way to resolve the issue?

@AnuragJain refer this documentation section for when to use deployment aware property.

https://docs.camunda.org/manual/7.13/user-guide/process-engine/the-job-executor/#job-execution-in-heterogeneous-clusters

Hi @aravindhrs @Webcyberrob
Thanks for the reply, I have understood when to use deployment aware property, this talk was very helpful.

Now I have a question
Assume that
I am running multiple camunda node (node1, node2…) and few jobs of node1 are in-progress. Now node1 gets restarted and hence node1 will not pick the pending jobs due to deployment_aware setting true.

As a best practice I have to set deployment aware config to True otherwise I will start getting other errors like classname not found etc.

What will be the approach so that even after having deployment_aware setting true jobs get picked by camunda after it restarts?

Hi,

You have a choice of architectures, either a war file deployed to a web container such as tomcat, a springboot approach or a shared engine with processes deployed via rest API. The first two approaches support high availability via clusters fairly easily. If you use the last approach, you would need to set deployment aware false for Async executions to start after a server restart. The consequence of this is if your processes need resources such as delegate classes etc, they would need to be deployed into the engines classpath as a library…

There are some subtle, advanced variations on the above, but that’s a brief overview…

So consider your architecture and its characteristics to your desired operational characteristics…

Regards

Rob