As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
int retries = 3; while (retries > 0) { try { runtimeService.messageEventReceived(messageName, task.getExecutionId()); break; } catch (ActivitiOptimisticLockingException ex) { if (–retries < 1) { // fatal, escalate } try { // give some time to recover, allow other instance to finish work on process Thread.sleep(100); } catch (InterruptedException e) {} } }