This training covers using the stack-system module to configure a Canary page in your Spring Application
- The Java Stack
- Your favorite IDE, ready to import a maven project
- Download the lab code and import the project into your favorite IDE.
- Get your application deployed and running in Tomcat.
- Go to http://localhost: 8080/stack-project/canary
- Notice that no resources were defined, only "Information". We'll add a resource in the next lab.
- View the page source to see the XML behind the page.
Add a Database Check to Your Canary Page
- Add a database checker to your canary page. In applicationContext.xml, inside the resource-checks element, add...
<stack-canary:range-database-check name="Example Row Count" query="select count(*) from example" min="1" />
- Restart your server and go to http://localhost: 8080/stack-project/canary
- Notice the check failed - there aren't any rows in the example table.
- Go to http://localhost: 8080/stack-project/ and add an "Example" record.
- Go back to the canary page and refresh. Notice the check still fails if the cached response has not yet expired.
- Notice the timing information in the detail of the resource; wait until the cache has expired and reload the canary page.
Shawn did a demo on registering and updating a canary page with Nagios using the ASE Assist Tool. The recording is available on the Middleware Training Wiki. This resource is only available inside the church network as it is only relevant to church projects.