如何使用同一触发器在quartz调度程序中调度多个作业?
我在我的春季项目中使用石英调度程序。我必须在计划每 15 分钟运行一次的作业之后运行一个作业吗?我无法同时运行此作业,因为这两个作业必须使用不同的协议访问相同的邮件帐户(一个用于发送:smtp,另一个用于接收:imap),这可能会导致问题。请尽快回复,因为这是紧急要求。
I am using quartz scheduler in my spring project. I have to run a job after another job which is scheduled to run in every 15 mins? I cant run this job concurrently as both of this jobs have to access same mail account using different protocols(one to send:smtp and other to receive: imap) and it may cause problems. Please reply quickly, as its an urgent requirement.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

只需编写一个包装作业类,在第一个作业之后启动第二个作业。如果有必要的话,您可以在将来重复使用单独的作业。
Just write a wrapper job class that launches second job after the first. You could then reuse separate jobs in the future if there will be any necessity.