Worker applications
In Chapter 6, Deploying Apps to Cloud Foundry, you learned how to build and deploy a simple web application into Cloud Foundry on PCF Dev. Once the application was pushed onto PCF Dev, the platform created a route to the application that could then be used by the users to communicate with the various endpoints exposed by the application. In this section, we will talk about the applications that have no route, but that run in the background, performing a task. A worker application is basically a process, lower level than a web application, that maps naturally to many so-called back-office jobs.
These applications generally have no API endpoints, and can be treated as the jobs that are run every night, to keep various systems in sync. A worker application can be written in any language and be deployed into Cloud Foundry.
Fortune teller worker application
We will now build a Spring Boot application that will run every five seconds and output a random fortune. Let's call this...