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:
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