Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Retry tasklet in Spring batch?

Tags:

spring-batch

How to retry a method invoker task, I know that if a chunk task fails there is option to retry and there is option to setup backoff policies but, in method invoker task xsd I can't find retry option. Is there any other alternative to retry the task in case of failure.

like image 300
Karthik Prasad Avatar asked Oct 22 '22 00:10

Karthik Prasad


1 Answers

You can use spring-retry and declarative retry; just apply <aop:config> tag and configure interceptor.

To change the policies or listeners, you only need to inject an instance of RetryTemplate into the interceptor

like image 114
Luca Basso Ricci Avatar answered Oct 24 '22 02:10

Luca Basso Ricci