Create a timed task with spring

Source: Internet
Author: User

Ah spring task seems to be a simple feeling, but it still takes a lot of energy to get up, because I haven't touched this thing before, all when the task is given to me, I am a fog. Then I'll check all the information.
One of the most impressive is the version of the problem and the lack of rack package problems, using this set of older rack package, pro-test is possible

Specific implementation I will not say, need to see this, write very detailed, = = really want to thank the author.
I want to talk about something that needs attention.

1 It's easy to forget. Xxx.asm.jar and Xxx.transaction.jar forgot to add.
2SLF4J's rack-bag forgot
3. If you use the spring4.0 above to note the Quartz.jar version, there will be a version caused by the error, the general will appear error.
4 If it is a configuration file, you should pay attention to scan package, otherwise nothing effect
5 About configuration Files

<task:executor id= "executor" pool-size= "ten"/> <task:scheduler     id= "Scheduler" pool-size= "    />" <task:annotation-driven scheduler= "Scheduler" executor= "Executor" proxy-target-class= "true"/>

This specific parameter API also has
6 The need to be aware of the target class is to be managed by IOC and @scheduled (cron= "0/2 * * * *?") This remember to write an estimate that the average person would write for having the statement lazy must remember to be declared in
On the class.

About Spring task This is because it is a two-time development project obviously wrote a demo can but put in the project in the wrong, so it will make a headache. But in the end the feeling is good.

Create a timed task with spring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.