Hi all,
Following setup:
Spring Boot Version: 3.2.7
Spring Boot Starter Camunda: 8.5.3
JDK: 21
Running Camunda via Docker Compose with Version: 8.5.3
We have a Controller which is triggered from the Frontend and creates a new Process instance:
@Transactional
public void createProcessInstance(String bpmnProcessId, Long applicationId) {
.... some preparation and checks ....
ZeebeCreateInstanceVariablesDto variablesDto = ZeebeCreateInstanceVariablesDto.builder()
.applicantId(user.getId())
.applicationId(applicationId)
.build();
Long processInstanceId = zeebeClient.newCreateInstanceCommand()
.bpmnProcessId(bpmnProcessId)
.latestVersion()
.variables(variablesDto)
.send()
.join()
.getProcessInstanceKey();
.... updating entiy here ....
}
After this the process is started and goes to the first UserTask in our Camunda Process.
Now we would expect that the Job Worker of type io.camunda.zeebe:userTask is triggered.
@Transactional
@JobWorker(type = "io.camunda.zeebe:userTask", autoComplete = false, fetchAllVariables = true, streamEnabled = false)
public void handleUserTaskCreate(
final ActivatedJob job,
@CustomHeaders final Map<String, String> headers,
@Variable(name = "applicationId") final Long applicationId,
@VariablesAsType final JsonNode variables
) {
final Long stepKey = job.getKey();
final String stepName = job.getElementId();
final String assigneeHeader = headers.getOrDefault("io.camunda.zeebe:assignee", null);
final Long assigneeId = Long.parseLong(assigneeHeader);
final String jsonFormHeader = headers.getOrDefault("jsonForm", null);
.... load entites for checks and get data which is saved in the process step entity at the end ....
}
// this is an attempt for a workaround
log.info("Deactivate retries for step {}", stepKey);
zeebeClient.newUpdateRetriesCommand(job)
.retries(0)
.send();
}
When we start our setup with Docker Compose and start the process, it is not allways working as expected. The Application is successfully persisted, but the UserTask most of the time is not triggered on the first try. We don’t really see a log but on elastic we see that the process job is created, but goes to intent timeout. When we start another process it works directly and behaves as expected. Additionally when we restart our spring boot app the not triggered user task will trigger and also work as expected.
We have tried different configurations, with maxJobsActive, async vs sync process starting but nothing really changed this behaviour.
Do any of you have an idea what could cause our issues here ?
We also tried to seperate the transactional part, but that didn’t help us either. (https://camunda.com/blog/2023/12/navigating-technical-transactions-camunda-8-spring/)
Maybe linked to Zeebe Spring Client JobWorker needs up to 10 Minutes until gets active
Thank you for the support!
Best Regards