I am playing around multiple instances of camunda and I am facing Issue with the processing the message from rabbitMq. Below is the process diagram: order.bpmn (8.5 KB)
My invoking of process looks like this:
camunda.getRuntimeService().createMessageCorrelation(ProcessConstants.MSG_NAME_GoodsShipped) //
.processDefinitionId(UUID.randomUUID().toString())
.processInstanceVariableEquals(ProcessConstants.VAR_NAME_orderId, orderId) //
.setVariable(ProcessConstants.VAR_NAME_shipmentId, shipmentId) //
.correlateWithResult();
The process works fine when there is only instance of camunda running. But when I am running multiple instances, I am facing the below exception:
org.camunda.bpm.engine.BadUserRequestException: ENGINE-13025 Cannot specify a process definition id when correlate a message, except for explicit correlation of a start message.
I am running the instances on different port numbers and I am able to login to all of the instances if thats what you are trying to know. I can see the cockpit tasks pages in all the instances. When I bring up 2 instances, I can see 4 instances of process running in both of the instances. Let me know if you need more information
Thanks for the help. I understood ans resolved this issue.
The problem was that all the instances were identical and hence the engine was ambiguous to assign the message to any of the instance. So to resolve this, I started process with a unique business key and when the inbound message came, I fetched instance based on business key and assigned it the message processing.