KB Article #178147

Policy to check cassandra health

Problem

-- In addition to the healthcheck policy existing by default in API Gateway, it's also a good idea to check cassandra health, and so to know if we can access KPS data.

-- Here is how to build a policy to do this healthcheck.

Resolution

- Create a KPS Collection (status)


- In this Collection, create a new table (table with alias table)


- In table structure add a String field (string) and set it as primary key


- Save the table structure


- Create a policy (kpscheck):


* Add a set message filter:
content type can be text/plain
message body is (according to value when creating the table) ${kps.table['ok'].string}

* Make the set message filter follow by a reflect message filter


- Deploy


- Add a row containing ok in the table (using kpsadmin tool, Rest API or though API Gateway Manager (Settings > Key Property Stores)).