问题
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:
Can someone explain how
scheduler
ofSCDF
work?Are there any ways to schedule 1 job using
SCDF
?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