-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPHYK-356 remove opintopolku-healthcheck-api
- Loading branch information
Showing
9 changed files
with
38 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...t-client/src/main/java/fi/vm/sade/javautils/legacy_caching_rest_client/HealthChecker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package fi.vm.sade.javautils.legacy_caching_rest_client; | ||
|
||
/** | ||
* Healthcheckiin kuuluva tarkastaja, jonka roolina on tarkastaa yksi kohde healthcheckin yhteydessä. | ||
* SpringAwareHealthCheckServlet kutsuu spring application contextista löytyviä tämän HealthChecker -interfacen toteuttavia beaneja. | ||
* checkHealth -metodin palauttama objekti serialisoidaan JSON:ksi, ja liitetään healthcheckin checks -osioon kentäksi [beanName]. | ||
* Mikäli tarkastuksessa on virhe, checkHealth -metodin tulee heittää sitä poikkeus (jonka message kuvaa virhetilannetta). | ||
* Tällöin poikkeuksen message liitetään healthcheck tulokseen, ja koko healthcheckin tila on ERREOR. | ||
* | ||
* Esim: | ||
* | ||
* @Component("solrIndexed") | ||
* public class SolrIndexedCheck implements HealthChecker { | ||
* Object checkHealth() throws Throwable { | ||
* // tarkastetaan tässä onko solr indeksoitu | ||
* return new LinkedHashMap(){{ put("status", "OK"); put("previouslyIndexed", timestamp); }} | ||
* } | ||
* } | ||
* | ||
* ...johtaa tällaiseen healthcheck tulokseen... | ||
* | ||
* { | ||
* "status": "OK", | ||
* "checks": { | ||
* "solrIndexed": {"status": "OK", "timestamp": [timestamp]} | ||
* } | ||
* } | ||
* | ||
* @see SpringAwareHealthCheckServlet (in other module) | ||
*/ | ||
public interface HealthChecker { | ||
/** | ||
* @return something json-serializable that describes the state of this checker | ||
* @throws Throwable if there is health check error | ||
*/ | ||
Object checkHealth() throws Throwable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters