简体   繁体   中英

Java Schedule a task for single execution

I need to execute a task in the future, just once. Requirements: - The environment is clustered, so need to take care of competition in the moment that the task gets fired, it cannot execute twice; - The task can be scheduled a month ahead and cannot be just scheduled in memory as soon as the node can be restarted or even destroyed at a certain moments (it's an Amazon Elastick Beanstalk environment);

Any suggestions will be welcome.

一个想法:您可以尝试在所有节点上安排任务,而不是尝试使cron / timer工具仅执行一次,而是在节点之间使用某种协调方式来确定哪个节点将实际执行任务。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM