Java – using quartz and spring

In my application, I need to be able to create scheduled jobs (dynamically) based on the incoming request type

Can I also use spring to create and trigger jobs? If so, what?

Any help will be useful

Solution

Since schedulerfactorybean exposes the native quartz scheduler object, you can connect it directly to your controller class, and then use the scheduler object to dynamically create and register triggers and jobs

Spring itself cannot be used for scheduling dynamically created jobs, because spring beans support jobs that will be used for static configuration, but the native quartz scheduler API is reasonable enough to be used alone (almost none) As a trigger for work, it's Quartz's work, not spring's work

Editor: either I misunderstood the original problem, or everyone else Another answer to all the details is how to use spring to statically connect a series of jobs, but the problem is how to dynamically schedule jobs when requests enter

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>