We have been using camunda 7.4 version in most of our projects along with camunda-bpm-spring-boot-starter 1.1.0.
We have a project where in the camunda flow we try to publish a message to a message broker which internally is consumed by another system and re-publish a new message to the same message broker. Then we trigger a receiveTask to receive that message and process further. To listen to the incoming message we use org.springframework.amqp.core.MessageListener and we define the message co-relation for receiveTask within the onMessage() method. But we get below error in doing so
org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message 'ReceiveAmsharedResponse': No process definition or execution matches the parameters
We are trying to figure where the problem is? Is it in the version of camunda we are using or the problem is with the usage of receiveTask. We tried all approaches defined in https://docs.camunda.org/manual/7.4/reference/bpmn20/tasks/receive-task/ but no luck.
For the method createMessageCorrelation we get above error. And for other methods we get a NPE as EventSubscription/Execution objects are null.
Sample Camunda flow receiveTask Usage is as below:
<bpmn2:receiveTask id="ReceiveTask" name="Receive Task" messageRef="Message_06nl07f">
<bpmn2:incoming>SequenceFlow_xyz</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_190m9nx</bpmn2:outgoing>
</bpmn2:receiveTask>
......
......
<bpmn2:message id="Message_06nl07f" name="Message" />
And sample message co-relation code:
class XYZ implements MessageListener {
onMessage() {
runtimeService.createMessageCorrelation("Message")
.processInstanceBusinessKey(resourceId)
.setVariable(ACTIVITY_RESULT, activityResult)
.correlate();
}
Any help would be appreciated?
Thanks, Viswanath