Was experimenting running scheduled job on PCF. One natural choice is PCF scheduler, which comes with the Pivotal Web Services (PAAS). Googled around and found this example on DZone. The spring batch code is here. There was a small typo in the manifest.yaml,
|Note the snapshot.jar file name does not match what’s specified in the build.gradle file.|
The correct file name is
The rest of the manifest.yml looks good, in fact I used the following options for my spring scheduler app manifest.
But PCF scheduler is not available in our environment. The Spring Scheduler is used instead. I followed this Get Started Guide from Spring. In my case I need to use Cron Expression, here is the code sample and here is the guide to cron expression.
Last but not least, in my case I need to send out email notification for the cron job conditionally. I used the java email code sample here.
Some PCF references
pivotal web serivce
cf login -a https://api.run.pivotal.io/
cf login -a api.local.pcfdev.io --skip-ssl-validation