How does one "backoff and retry" an entire job?
Here's my use-case:
- in response to an external event, generate a bunch of alert text messages
- for each person who has signed up for an alert, try to deliver their message to them
- if that person lives in a timezone such that the moment of delivery falls in a "blackout period" for them, don't deliver the message to them. try again later
I have a spring batch job (2.1.1) that has 2 steps: generate, deliver. If, during the delivery step, I find a person for whom it's the middle of the night (maybe they live in Japan or something), I want to skip them and come back later.
The backoff & retry policies configurable in a FaultTolerantStepFactoryBean don't quite work in this use case because they'll immediately backoff and immediately retry that person's alert. I want to skip them, deliver everyone else's alerts, and then retry them 6 hours later.
How might one do that with spring batch?