How to set scheduler for Spring Batch jobs in Spring Cloud Data Flow?

风流意气都作罢 提交于 2019-12-11 06:58:09

问题


I’m setting up a new Spring Batch Jobs and want to deploy it using SCDF. However, I have found that SCDF does not support scheduler feature in local framework.

I have 3 questions to ask you:

  1. Can someone explain how scheduler of SCDF work?

  2. Are there any ways to schedule 1 job using SCDF?

  3. Can I use my local server as a Cloud Foundry? and how?


回答1:


Yes, Spring Cloud Data Flow does not support scheduling on local platform. Please note that the local SCDF server is for development purposes only and by design, the scheduling support is intended to be relying on the platform. Hence, SCDF scheduling feature is supported on Cloud Foundry and Kubernetes using the CF and K8s schedulers.

1) Can s/o explain how scheduler of SCDF work?

sure, Similar to how the deployer is used for launching task/deploying the stream, there is an SPI for scheduling the tasks under spring-cloud-deployer project. The underlying scheduler implementations can implement this. Currently, we have CF and K8s scheduler implementations in spring-cloud-deployer-cloudfoundry and spring-cloud-deployer-kubernetes.

As a user, you can configure a scheduler for a task (batch) application (via SCDF Dashboard, shell etc.,). You can specify a cron expression to schedule the task. Once configured, the SCDF delegates the schedule request to the platform scheduler using the above-mentioned scheduler implementations. Once scheduled, it is the platform (PCF scheduler on CF, K8s scheduler on K8s) that takes care of the task using the schedule.

2) Are there any ways to schedule 1 job using SCDF?

Yes, based on the answer from 1

3) Can I use my local server as a cloud Foundry? and How?

To run SCDF on local pointing to the CF instance, you can set the necessary CF deployer properties and start the SCDF server instance. It is similar to how you configure multi platforms in SCDF server. You can find more documentation on this here.



来源:https://stackoverflow.com/questions/58478802/how-to-set-scheduler-for-spring-batch-jobs-in-spring-cloud-data-flow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!