cancel
Showing results for 
Search instead for 
Did you mean: 

How to restart an Application in Cloud Foundry by Scheduler

gwerner
Participant
0 Kudos

Hello,

we have an Java Application which is running in the Cloud Foundry. We want to restart this app by a Scheduler. Is that possible. I know that there is a Job Scheduling Service in the Cloud Foundry. I want to know how to restart an App with the SDK API.

Thank's

Gunter

gregorw
Active Contributor
0 Kudos

Hi Gunter,

my question is: Why do you need to restart the app in the first place?

CU
Gregor

gwerner
Participant
0 Kudos

Hi Gregor,

if the application is started, data will we download. This data will be changed min. once a month. So to refresh this data I need a mechanism to restart this application.

Accepted Solutions (2)

Accepted Solutions (2)

mariusobert
Developer Advocate
Developer Advocate

If I understand you right, you want to do something similar to what I've build in this post here. Maybe it helps you.

gwerner
Participant
0 Kudos

Hi Marius,

thank's for your answer. It helped me to unterstand the Scheduler. But I want to restart an app with a Scheduler. But the task is bound in the app. I will use this command

cf <appname> restart

This should be done by a Scheduler.

regards

Gunter

mariusobert
Developer Advocate
Developer Advocate

Why do you want to restart the app? My suggestion would be that you define a (npm) script that does the same thing as your app. You should think of this task on the "application level" and not on the "Cloud Foundry level". Then, you could use the schedules just as described in my post to trigger this script. E.g. with "npm start".

gwerner
Participant
0 Kudos

In my case the data will be not stored and hold in the memory of the app.

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

I don't see how this last comment contracts with my previous one. Neither does the app in my post store the data in the memory of the app.

gregorw
Active Contributor

What's about using the Job Scheduler Service and provide an API endpoint in your app that can be used from the Service to trigger the data download once a month?

gwerner
Participant
0 Kudos

The data will not be stored! The data will be hold in the memory of the application.

gregorw
Active Contributor
0 Kudos

Why should this not be possible by calling an API endpoint?

Answers (0)