Skip to content

Commit

Permalink
Avoid subscription for user tasks if the deployed processes does not …
Browse files Browse the repository at this point in the history
…contain any
  • Loading branch information
ckoesner committed Feb 27, 2024
1 parent b7fe56b commit ace78d5
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ public void accept(
public void openWorkers() {

// fetch all usertasks spawned
workers.add(
client
.newWorker()
.jobType("io.camunda.zeebe:userTask")
.handler(userTaskHandler)
.timeout(Integer.MAX_VALUE) // user-tasks are not fetched more than once
.name(workerId)
.tenantIds(userTaskTenantIds.stream().toList()));
if(!userTaskTenantIds.isEmpty()){
workers.add(
client
.newWorker()
.jobType("io.camunda.zeebe:userTask")
.handler(userTaskHandler)
.timeout(Integer.MAX_VALUE) // user-tasks are not fetched more than once
.name(workerId)
.tenantIds(userTaskTenantIds.stream().toList()));
}

workers
.forEach(JobWorkerBuilderStep3::open);
Expand Down

0 comments on commit ace78d5

Please sign in to comment.