No Co-relation Id found In camunda engine

Hi there,

I am facing one of the issue in process engine for no corelation id found is receive task and my task get stuck there in receive task even though after receiving Event from the another system, the process is as follows

Process Engine

  1. Start
  2. Send task( Send JMS message )
  3. Receive Task( Spring Streams) Receive JMS Event through Messages( But here it sometimes fails for corelation id)
  4. End Task

Is there any solution to avoid this, like transactional or run camunda process parallel or something I left to configure here in camunda engine,

Thank you

Hello @Durgesh_Patkari ,

does the response from JMS come very quick? If yes, you may use a retry after short period to let the engine get to the wait state inside your process.

Another option is to wait for the response in parallel while sending the message.

I hope this helps

Jonathan

Hi Jonathan,

Thanks,

But here sub-flow.bpmn (3.3 KB) task-flow.bpmn (5.8 KB)

if you see, task-flow.bpmn which is main flow, it does not have any issue, but only in sub-flow, sub-flow not able to map correlation id with help of message event through JMS as I am trying to map with flow in receive task, how I am doing is as follow,

  1. trying to read the task is there in same stage by checking count as below
    long correlatingInstances = runtime.createExecutionQuery()
    .messageEventSubscriptionName(“Event-type”)
    .processInstanceBusinesskey(“business-key”)
    .count(); // here sometimes we get 0 but when we check the process though ui, it is still in same receive task in sub-flow receive task,
  2. if i found it then I update values as below snippet or if i dont then so I was not able to update the value for my flow in this stage and cant pass same to next stage,

runtime.createMessageCorrelation(“Event-type”)
.processInstanceBusinesskey(“business-key”)
.setVariable(“Data”,"DataValue’)
.correlateWithResult();

please help me check on this

Hi @Durgesh_Patkari,

Do you mean that sometimes below query:

runtime.createExecutionQuery()
.messageEventSubscriptionName(“Event-type”)
.processInstanceBusinesskey(“business-key”)
.count();

returns zero whereas an execution token is waiting at receive task (shown in cockpit).

Have you confirmed that the execution token shown in cockpit is related to the same business key you are querying?

returns zero for me, but when I log in to workflow in camunda it shows me waiting stage…

So, Any solution guys on this, @jonathan.lukas @hassang , Please let me know, try to implement with StreamListeners and workflow with events, and share possible solution on this issue? is this solace is so fast enough than camunda processing, from one stage to next stage…

Hello @Durgesh_Patkari ,

I can provide 2 possible Ideas:

  1. Use a retry to poll multiple times with a small timeout. This is quick’n’easy and only in your code
  2. Create a small “Message correlation process” that can be started on receiving a message and then correlates the message to the “target process”. Big advantage: You are inside the engine again and if any problems come up, you can handle these inside the engine.
    image

Hope this helps

Jonathan

Hello @jonathan.lukas ,

Possible drawbacks

  1. It will keep me hold and acquire my threads and process will wait in process
  2. All the processing is based on event driven, with Messaging layer(in/out are messages), so how could this help? any samples on this?, it would be great if it does not wait inside running process, which will consume threads and time and problem solved without causing any processing delay…

Point to note: Message should be consumed through camunda process and then to be moved ahead, without causing delay(not using camunda message endpoint)

Thank you.

Hello @Durgesh_Patkari ,

how will you then consume the message if not with a message endpoint?

Jonathan

Hi @jonathan.lukas ,

we are correlating with below snippet,

runtime.createMessageCorrelation(“Event-type”)
.processInstanceBusinesskey(“business-key”)
.setVariable(“Data”,"DataValue’)
.correlateWithResult();

Durgesh

Hello @Durgesh_Patkari ,

the solution 2 helps as the correlation cannot fail as you always trigger a start event. Inside the engine, another message is sent towards the actual receiver. This mini process is a bridge from your Message Bus towards your target process.

When starting this Bridge process, you will need to provide the message name, the correlation keys and the variables which you want to send towards your target process.

I hope this makes it clear.

Jonathan

Thanks @jonathan.lukas ,

One thing I got clear is that if message received early than correlating variables, it fails, so either it should be delayed or should retry after few seconds for correlation process,

thank again…

Hello @Durgesh_Patkari ,

this sums it up very well. Do you have more questions on this or is this a suitable solution for you?

Jonathan

1 Like

Thanks @jonathan.lukas , no more questions on this, seems will work things out after this,

Good day…

1 Like