Correlate message triggered by JmsListener strange behaviour

Hi,
I listen to a Azure service-bus via JmsListener. If an event arrives I want to correlate a message (a part of the message name and the process business key is given by the data of the Azure event in order to create a message correlation).
When the correlateWithResult-call is done the whole process is finished (the process is gone in the cockpit of camunda).
If I correlate the message via the task list the bpmn process works fine!

The BPMN model:

bpmn|690x216

The class to listen for service bus events and to correlate the camunda message:

package com.mh.test.camunda.servicebus;

import javax.inject.Inject;
import javax.jms.JMSException;

import org.apache.qpid.jms.message.JmsTextMessage;
import org.camunda.bpm.engine.RuntimeService;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import com.google.gson.Gson;
import com.mh.test.camunda.model.EventTask;

@Component
public class ServiceBusCamundaListener {

	private static final String TOPIC_NAME = "topic-camunda";

    private static final String SUBSCRIPTION_NAME = "subscription-topic-camunda";
	
    Gson gson = new Gson();
    
	@Inject
	private RuntimeService runtimeService;

	
    @JmsListener(destination = TOPIC_NAME, containerFactory = "topicJmsListenerContainerFactory", subscription = SUBSCRIPTION_NAME)
    public void receiveMessage(Object input) throws JMSException {
    	JmsTextMessage jbm = (JmsTextMessage) input;
    	
    	String content = jbm.getText();
    	EventTask eventTask = gson.fromJson(content, EventTask.class);
    	
    	String action = eventTask.getAction();
		String processBusinessKey = eventTask.getProcessBusinessKey();
		
		runtimeService.createMessageCorrelation("Message_" + action).processInstanceBusinessKey(processBusinessKey).correlateWithResult();
    }

}

Debug logdata:

log.txt (93.8 KB)

Regards,
MaHa

Hi,

In your process model, it looks like you have an interrupting boundary catch event on the user task which leads nowhere…Hence if you correlate on this, I would expect the process to end…

Im not sure what you mean by correlate via the task list…

regards
Rob

Thanks for the quick reply! That was the reason. I changed the model. The correlate-call now works as expected.