Hi, I need to catch a message, process it and go next. Thus sometimes it takes too long for a message to arrive, and if it doesn’t arrive say in 3 minutes - I’d go next and process it in background. Processing performs some side effects thus hardly affects the context/variables states etc.
How could I achieve that?
My current solution looks like doesn’t process message (updates DB) if message arrives later then in 3m.
message handling is :
void onMessage(message) {
process = find process by message.repsonse-id
runtimeService.createMessageCorrelation("message-name")
.setVariables(Map.of("is-received-message-name", "true"))
.processInstanceId(processId)
.correlateWithResult();
}