Results 1 to 2 of 2

Thread: How does one "backoff and retry" an entire job?

  1. #1

    Default How does one "backoff and retry" an entire job?

    Hi,

    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?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    The usual way to do that would be to write the skipped items out somewhere (or mark them in some way), so they can be processed later (e.g. with a special job execution that might be identical to the first, but have a different input source).

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •