Hi,
My name is Victor, Tech Lead and Architect at Yotpo.
We are currently evaluating camunda 8 as our microservices orchestration solution.
In addition, we are trying to understand if we can use it for batch jobs.
I have created a POC project and trying different scenarios.
Here is the code for the batch POC I am trying:
@SpringBootApplication
@EnableZeebeClient
public class BatchItems {
private static final Logger log = LoggerFactory.getLogger(BatchItems.class);
public static void main(String[] args) {
SpringApplication.run(BatchItems.class, args);
}
@ZeebeWorker(type = "create-items", autoComplete = true)
public Map<String, Object> createItems(final @ZeebeVariable Integer count) {
log.info("Starting create-items, count: {} ", count);
// Probably add some process variables
HashMap<String, Object> variables = new HashMap<>();
List<String> items = IntStream.range(1, count)
.boxed()
.map(i -> "item"+i)
.collect(Collectors.toList());
return Collections.singletonMap("items",items);
}
@ZeebeWorker(type = "item-processor", autoComplete = true)
public void itemProcessor(final @ZeebeVariable String item) {
log.info("Starting item-processor, item: " + item);
}
@ZeebeWorker(type = "notify-done", autoComplete = true)
public void notifyDone(@ZeebeVariable Collection<String> items) {
log.info("Completed, items count: " + items.size());
}
}
When I run this scenario with 10K items it hangs and then starts after a while.
The issue is that only part of ‘item-processor’ tasks are actually starting.
The process remains in the ‘running’ state and those tasks never started/accomplished.
Pls find my project here: GitHub - victor-prp/camunda-poc
Pls advice.
Many thanks
Victor