Incident was not created even same service task failing multiple times

I am using zeebe broker and spring-zeebe-starter as a client. if the same service task fails I am throwing an exception then the log says sending a fail command to broker. Still, broker not creating the incident. so it repetitively calling the same service.

here is my code and logs

@Override
	@ZeebeWorker(type = "saveUser")
	public void saveUser(final JobClient client, final ActivatedJob job) {
                     	Com com = getCom(job);  
                      com=   UserService.save(com);
                  if(com==null)
                       throw new WorkflowException("excpetion  some error");

client.newCompleteCommand(job.getKey()).payload(toJson(com )).send().join();

}

here is my log from spring boot client

2019-05-15 16:25:48.809e[0;39m e[33m WARN [sample-component-workflow-handler,,,]e[0;39m e[35m17976e[0;39m e[2m---e[0;39m e[2m[pool-8-thread-1]e[0;39m e[36mio.zeebe.client.job.worker              e[0;39m e[2m:e[0;39m Worker component-workflow-handler failed to handle job with key 100242 of type saveUser, sending fail command to broker

java.lang.reflect.InvocationTargetException: null
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.zeebe.spring.client.bean.MethodInfo.invoke(MethodInfo.java:31)
	at io.zeebe.spring.client.config.processor.ZeebeWorkerPostProcessor.lambda$null$1(ZeebeWorkerPostProcessor.java:49)
	at io.zeebe.client.impl.subscription.JobRunnableFactory.executeJob(JobRunnableFactory.java:42)
	at io.zeebe.client.impl.subscription.JobRunnableFactory.lambda$create$0(JobRunnableFactory.java:37)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.sample.model.workflow.WorkflowException: excpetion  some error
	at com.sample.business.workflow.component.handler.service.impl.ComponentWorkflowHandlerServiceImpl.validateQuantity(ComponentWorkflowHandlerServiceImpl.java:238)
	at com.sample.business.workflow.component.handler.service.impl.ComponentWorkflowHandlerServiceImpl$$FastClassBySpringCGLIB$$f9512a9d.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
	at com.sample.business.workflow.component.handler.service.impl.ComponentWorkflowHandlerServiceImpl$$EnhancerBySpringCGLIB$$d47138a7.saveUser(<generated>)
	... 14 common frames omitted

Hi @regojoyson,

  1. How many retries specified in your BPM model for this task?
  2. What version of the broker are you using?
  3. Can you share your sample code and BPMN model in a GitHub repo?

Josh

1 Like

Hi, @jwulf Thanks for the quick response.

I am using following versions
zeebe broker : camunda/zeebe:0.17.0 (docker)
spring client : spring-zeebe-starter:0.4.0

Number of retries : 3

the incident was not creating only in spring-zeebe-starter. but if I use zeebe-client-java it works fine.

I will share my code tomorrow.

Thanks
Joyson

Which is the best client to use with spring boot? spring-zeebe-starter or zeebe-client-java

Any suggestions Please.

Hi @regojoyson - spring-zeebe-starter is not as well maintained as the zeebe-client-java:

Compare:

When you are selecting an open-source component to base your project on, you want to use something that has traction and is being actively maintained.

Here is what I suggest:

Given that you have isolated the issue to the Spring starter, create a minimal reproducer repo (see: How to create a Minimal, Reproducible Example - Help Center - Stack Overflow) and push it to GitHub. Then open an issue in the Zeebe Spring Starter repo, and link to your reproducer.

Then see how fast it gets addressed. If there are no engineering resources being applied to zeebe-spring-starter (from Camunda or the community) then go with the one that has momentum for your project.

The benefit of open source is that you leverage the momentum of a community.

1 Like

Hi @regojoyson,

thanks for reporting this issue. I was able to reproduce it and created the following issue https://github.com/zeebe-io/spring-zeebe/issues/56.

I also created a PR to fix the underlying problem https://github.com/zeebe-io/spring-zeebe/pull/57.

Cheers,
Sebastian

2 Likes

Looks like that project has some traction :grinning:

1 Like