My latest open source contribution is Play! Jobs, hosted on the always awesome Github.
Play! Jobs is a Web Interface to manage and trigger async jobs running on a Play! Framework application. It also provides a JAX-RS/RESTFul API, exposed with JSON and powered by Play!’s RESTEasy Module. This API is a good start, it might turn out to be a extremely powerful feature since we all know how useful and critical it is to monitor production environments.
- Install Module as a local dependency or copying it to the modules directory
- Add the module routes to the application that’s using Play! Jobs (your application)
- Start your play application (play run)
- In your browser, go to http://localhost:9000/@jobs (assuming you are using the default port) You should see all the jobs defined on your application, basically all your classes that extend play.jobs.Job.
Using Play!’s RESTEasy’s module. All the business logic is encapsulated on the service class JobsService which contains the annotations necessary to expose the service and bind it as a JSON interface. This JSON interface is useful if you need to hook your Play! application into a monitoring solution like Nagios.
The source code is available on mashup-fm/play-jobs.
Special thanks to Marc Deschamps.