如何从主班上调用调度程序
我的应用程序每天有两个调度程序在特定时间每天运行,每天每天进行1小时的时间间隔。 我在deploy.yaml中添加了cron表达式,而无需使用调度程序标签。我正在呼叫app.java ..的第一个调度程序..但是现在我对第二个调度程序感到困惑我打算使用交换机实施。有人可以帮助我。
Deploy.yaml`spec: scheduler:* * * * * *`
Public class job2 {Public void job2function() {}`}`}`
Public class job1 { `public void job1fun(){}`}`}`
My application have two schedulers one runs every day at a particular time and another scheduler every day at and interval of 1 hour.
I have added the cron expression in deploy.Yaml without using the scheduler tag.I am calling the first scheduler from App.java..But now I am confused about the second scheduler how can I call the second scheduler in App.java.I am planning to implement with a switch.can someone help me on this please.What I am trying is to route to the scheduler using Java configuration without using XML Configuration
Deploy.yaml`spec: scheduler:* * * * * *`
Public class job2 {Public void job2function() {}`}`}`
Public class job1 { `public void job1fun(){}`}`}`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为调度程序作业定义2个组件。
Spring Boot将自动安排相关组件作为要运行的工作。
在上面的cron表达式中,它可以在您的deploy.yaml文件中进行自定义以指定它们。
Deploy.yaml:
请尝试。
You can define your 2 components for the scheduler job.
Spring boot will automatically scheduled the related components as a job to run.
And in the above cron expression, it can e customized in your deploy.yaml file to specify them.
deploy.yaml:
Please try it.