Hi Camunda Team,
I have a JavaDelegate that calls an external API my question is:
If my API response return a 4xx, 5xx status code, I want to retry it for 3 times with some interval if after the all retries I dont get 200 from API, I want to finish my process WITHOUT open an incident to be handle manually.
Any suggest?
Ex:
Java code:
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
try {
ApiCall.call();
} catch (BaseException ex) {
//retry again
}
hassang
December 31, 2021, 8:23pm
2
Hi @gabryellr ,
Below post might be of help to you
Just used this code - works like a charm:
public class GuardedServiceA implements JavaDelegate {
private static final String NO_RETRIES_ERROR = "NO_RETRIES";
public static boolean fail = false;
public static int countFailed = 0;
public static int countSuccess = 0;
@Override
public void execute(DelegateExecution ctx) throws Exception {
JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
if (jobExecutorContext!=null && jobExecutorContext.getCurrentJob…
sftr
December 14, 2022, 2:53pm
3
Hi, maybe you can help me . How do you implement that ApiCall.call ? Do you have an example code that can help me?
Thanks