Set custom retries based on type of exception


I am using Service Task with JavaDelegate to call an external web service.
As per my understanding, the task is automatically retried 3 times if any exception is thrown from JavaDelegate. I want to override this logic based on the type of error/exception.

For example:

  1. If I get 500 Server error back from the web service call, I want to retry once after X mins.
  2. If I get 4XX HTTP error back from the web service, I want to do zero retries and create incident right away.

How can this be achieved in the JavaDelegate? Is there anyway to set the retry count based on some logic implemented in JavaDelegate?


@Niall @Ingo_Richtsmeier or anyone can please answer this?

Hi @yogeshrnaik,

I think, (but I’m nor sure) that it is not possible to influence the retry behavior once the Java delegate is invoked.

It’s different with external tasks, as you have to return the retries from your business logic: You can have a look into the REST endpoint here:

Hope this helps, Ingo