Hi,
In the following workflow:
I start a process instance of “User”. Then the flow will continue as "(User: Start → Enter file info → Request the file) → (File Server 1: File requested → Task1 → Send the file). Then I encounter error message “org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message ‘ReceiveTheFile’: No process definition or execution matches the parameters” in the terminal several times.
I have set “Asynchronous Before” and “Exclusive” for “Send the file” task. The message name set for “Receive the file” is “ReceiveTheFile”, which matches the name of the message I am sending.
“Send the file” task is implemented as an external task and I send message by invoking “sendMessage” in the following code:
private static void sendMessage(HttpRequest messageRequest) throws IOException, InterruptedException {
var sendMessageResponse = HttpClient.newHttpClient().send(messageRequest, HttpResponse.BodyHandlers.ofString());
System.out.println(sendMessageResponse.body());
}
private static HttpRequest prepareMessageRequest(String businessKey) {
var messageDto = new MessageDto("ReceiveTheFile", businessKey);
var gson = new Gson();
var jsonStr = gson.toJson(messageDto);
var messageRequest = HttpRequest.newBuilder(URI.create("http://localhost:8080/engine-rest/message"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonStr))
.build();
return messageRequest;
}
private static class MessageDto {
public MessageDto(String messageName, String businessKey) {
this.messageName = messageName;
this.businessKey = businessKey;
}
private String messageName;
private String businessKey;
}
I have also set “businessKey” to businessKey of “User”.
Could anyone guide me what the problem is? I had used this message correlation before and it worked fine.
The strange thing is that although I encounter this error message, the history of “User” is as follows:
Even when the error boundary event of “Task1” catches an error, and so the token does not arrive to “Send the file”, I still see a token has passed “Receive the file”, but with several exceptions in the terminal (MismatchingMessageCorrelationException).
I do really appreciate any help.