title: Spring batch - restart FAILED job that uses TaskExecutor
body: <p>What is the proper way to restart FAILED spring batch job that is using TaskExecutor? </p>
  
  <p>I have a job that is loading data from HTTP and sometimes there is 500 error - making this job fail). I would like to restart this job until it is successful.</p>
  
  <p>If I make JobExecutionListener and implement logic inside afterJob() method, I get error message that this job is actually running. If I use RetryTemplate from Spring, this also doesn't work since this is running inside TaskExecutor.</p>
  
  <p>Any code sample would be of a great help.</p>