After reading all the articles I could not find a solution to my problem.
- I have a java play web-app running good on Heroku. With a web: xxx process in the Procfile
- In the same app, I have defined some Jobs.
- I have MyJob class which extends play.Job
- I have a Main class while(true) wait and execute MyJob.
my Procfile looks like this.
web: play run --http.port=$PORT $PLAY_OPTS
worker: java -cp target/classes;target/dependency/* jobs.MyJob
I understand that since this is not a maven project classes and dependency directories dont exists.
But then, how shall I set the worker: java xxxx command?
Are you annotating your Job classes? To start a job when Play starts, just do:
Or use the @Every or @On annotations: