Hi - I have question around Exception handling in Camunda 8.2
I am using Spring-zeebe worker to complete service task in the process . I had set autocomplete to false and have try catch block in my worker code .
In an event of exception , i am throwing fail command in catch block which reduces the retry count to zero and eventually when retry count is zero , it creates an incident .
I have below question :
My worker does following things -
Step 1 : Update the Database tables related to process date
Step 2 : Update certain variables in camunda
Step 3 : send message to kafka
Step 4 : Update the Database table related to audit logs
My question is if it fails at step 4 and creates an incident then after incident is resolved it will start executing worker from start so will execute all step again which is not desired .
What are the ways to ensure it only executes the step which was failed . for example if step 4 failed in above i dont want kafka message to be sent again from step 3 .
Do we need to put every step in single service worker ? How do we basically do transaction management in zeebe worker if it has multiple steps /calls to multiple services .