As you hopefully know by now Bluemix.info is a news aggregator for IBM Bluemix developers and professionals covering news about everything related to IBM’s platform as a service, including runtimes, services, events and much more. Curators decide which content is published on the site. To make it as easy as possible for curators, certain websites and blogs are checked on a scheduled basis whether there are new articles. If so, the information is put in a queue on Bluemix.info where curators can easily approve entries by just clicking an approve button.
This scheduled task reads new articles from websites via feeds and the open source library Rome. Check out FeedManager.java and RSSReader.java for details.
This task is triggered via the Workload Scheduler service (beta). The class SchedulerUtilities.java demonstrates how to use the scheduler service. It uses Java client libraries that you need to download and add to your project first. In SchedulerUtilities a task is created which is triggered every hour.
When the task is triggered, a REST API from Bluemix.info is invoked. In order to make sure only the task can trigger this API basic authentication is used. When the task is created a username and password is generated, passed to the scheduler service and stored in Cloudant. Before the REST API runs the core functionality it checks this username and password.
Since yesterday the workload scheduler service provides a nice dashboard that allows you to monitor your tasks.