Exception Cannot correlate message No process definition or execution matches the parameters

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.

Remember that Message Send and Message Received are a 1:1 setup.

Enclose the “Request the File” and “Receive the File” in a multi-instance subprocess to be able to send the request to multiple server processes and wait for the appropriate responses.

Since you’re sending the message to Server 1 and Server 2 at the same time, whichever one finishes first will send their file to the User process, and User will continue on. When User continues on, it’s no longer waiting for a file, so the other Server process will get an error “No process is waiting for this message”

Hi,
Thanks for the reply.
No. I am NOT “sending the message to Server 1 and Server 2 at the same time”. In “Request the file” it is decided that the file should be requested from which file server. So, when I receive this error, there is actually no token in “File Server 2”.

Model that explicitly with an Exclusive Split, and two message throw events, and see if you have the same issue…

I just found out what the problem is. It was"not" because of 2 file servers. The reason was that I had forgotten to invoke “externalTaskService.complete(externalTask);” at the end of the worker corresponding “Send the file”.
Thanks for your help anyway.

That doesn’t actually make sense.

org.camunda.bpm.engine.exception.NullValueException: no deployed process definition found with id 'User:1:523e7994-fa5a-11ed-ac42-34c93db2a2d7': processDefinition is null.

Suggests that you are actually starting another Process Instance, rather than correlating a message.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.