Warm tip: This article is reproduced from stackoverflow.com, please click
spring-boot spring-integration spring-integration-dsl

How do you make sure that Spring Integration poller works and executes missed schedules when a servi

发布于 2020-04-18 09:37:50
IntegrationFlows
        .from(() -> new GenericMessage<>(""),
                e -> e.poller(p -> p.cron("0 0/5 * 1/1 * *")))

In the case of the above integration flow, there is cron schedule for which an empty message is pushed into a particular queue. If the schedule was really long (Let's say every 2 weeks), and at the time the schedule is supposed to be executed, the service either restarts or shuts down. How do we make sure that it's executed as soon as the service is back up? Does Spring integration do this by default? (i couldn't find anything in the docs)

Questioner
Vikas Shetty
Viewed
70
Gary Russell 2020-02-04 21:45

There is nothing built into the framework to handle executions that were missed due to the application not running at the time of the expected execution.

For such wide execution delays, it would be better to use an external scheduler (anacron etc).