cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate message reception in message catching event

waldo
Champ in-the-making
Champ in-the-making
We have a cronjob that periodically (every 5s) tries to send a message to an arbitrary process execution waiting on an intermediate message catching event. In each run, the cronjob determines waiting process executions via
RuntimeService.createExecutionQuery().messageEventSubscriptionName(messageName).list()

and sends the message via
RuntimeService.messageEventReceived(..)


We experience the odd behaviour that two subsequent cronjob runs (5s apart) sometimes deliver the message to the same process execution (i.e. the execution query yields identical execution IDs), leading to an SQL exception during insert into ACT_RU_EXECUTION (ORA-02291: integrity constraint (ACT_FK_EXE_PROCINST) violated - parent key not found). There are no loops in our process, every execution expects only a single message.

I would expect that the process execution that received a message immediately gets removed from the message event listener list, so duplicate message reception is impossible. Can someone explain to me at which point in time the RuntimeService.messageEventReceived persists the information that the message was successfully delivered? Is this only done when the receiving process execution yields its thread?

Many thanks!
/Dennis
1 REPLY 1

trademak
Star Contributor
Star Contributor
Is it possible that the process execution takes more than 5 seconds? When the message is received a transaction is started and the process is executed until the next wait state. Only then the message event listener is removed from the database. If you have some long running logic you could add async behaviour to complete the transaction faster.

Best regards,
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.