Correlate Message directly from message event


why is it not possible in camunda to correlate a message directly from intermediate throwing message event without writing java code but defining a message to throw on bpmn event.

The semantic could be to correlate to receivers in same process instance. So if a receiver exits in same process instance this would directly work without writing java code.

Best regards,


Hi @Markus,

I think that message correlation is an engine specific functionality and there are too many ways to implement it.


Ok this could be a reason.
I found a simple solution for us and would like to share the code. Its a simple ExecutionListener activated with camunda reactor. It checks if intermediateThrowEvent ha a message and correlates it to all receivers in process instance with same business Key.

@CamundaSelector(type = "intermediateThrowEvent", event = ExecutionListener.EVENTNAME_START)
public class CorrelateMessageExecutionListener implements ExecutionListener {

public void notify(DelegateExecution execution) throws Exception {
	IntermediateThrowEvent event =(IntermediateThrowEvent)execution.getBpmnModelElementInstance();
	Optional<MessageEventDefinition> messageEventDefinitionOptional = event.getEventDefinitions().stream()
		.filter((ed) -> ed instanceof MessageEventDefinition)
		.map((ed) -> ((MessageEventDefinition)ed))
	messageEventDefinitionOptional.ifPresent((messageEventDefinition) -> {
				RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService();
				String messageName = messageEventDefinition.getMessage().getName();

			}else{"No message is thrown from execution=%s because no businessKey is defined in process instance",execution.getId()));


1 Like

Hey Markus,

maybe you can use the Signal Event instead, which will also do a broadcast.
See the Signal documentation for more information.

Best regards,


no that is no good solution for me because I dont want a process instance overall broadcast event but a event which is only delegated to receivers in same process instance.

The code posted below works fine for me.

Thank you and best regards,