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