cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to start a java application in BTP from Job Scheduling Service

kavya_kathuria
Product and Topic Expert
Product and Topic Expert
0 Likes
977

I have a JAVA application running in BTP.

kavya_kathuria_0-1716941503040.png

I would like to create a schedule to run this application every 24 hours and am trying to use the 'Job Scheduling Service' for the same. 

kavya_kathuria_1-1716941544087.png

I do not want to create a 'Job' for the same, as that would require having the application running 24x7 with a rest endpoint exposed, but that will consume too much memory. Instead, I want to be able to start the app once every 24 hours and am trying to create a 'Task' in the Job Scheduling Service Dashboard to do the same.

kavya_kathuria_3-1716941733575.png

I can't seem to figure out the supported 'Action' values for these. I want to write an action to start the corresponding application. Any help on the same would be greatly appreciated!

Accepted Solutions (0)

Answers (1)

Answers (1)

Willem_Pardaens
Product and Topic Expert
Product and Topic Expert
0 Likes

A cf task is pretty much any CLI command you want to send to the container of the app. But you will be constrained to the installed CLI commands in the container of what is possible.

For a NodeJs application I could run "npm start" to start my application or "node -v" to get version info, Java has similar commands. These commands would be the value for your 'action'.

To test which cli commands are understood in your container (before configuring the task) you could run the below in your terminal and check in the logs of the deployed app what the output/error is:

cf run-task MYAPP --command "echo 12345"
AG_DIGI
Newcomer
0 Likes
Hi Kavya, i am facing the same issue, what did you pass in "Action" for the spring boot application?