Prevent repeated execution of timed tasks

Prevent repeated execution of timed tasks

 

1. Caused by multiple node problems

   1. Use optimistic locking (based on version number)

   2. Use idempotency: the principle of optimistic locking is the same, the message will change the state of the business and the current state of the business will not be processed (has been processed), based on the state

   3, zk process lock, one obtains the lock and the other gives up, and then there is a confirmation system to see if it needs to be retransmitted. Retransmission is idempotent again.

   4, redis process lock

2. Repeated sending of network and other problems

 

 

 

Implementation of timed tasks;

1,timer

2,quartz

3,@schedule()

The third annotation scanning label that needs to open the scheduled task

<task:annotation-driven />

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326218719&siteId=291194637