@ Get ( "/health" ) public HttpResponse getHealth ( ) throws JsonProcessingException { Health health = healthEndpoint . health ( ) ; Map < String , Object > healthJson = new LinkedHashMap <> ( ) ; healthJson . put ( "status" , health . getStatus ( ) . getCode ( ) ) ; healthJson . put ( "zipkin" , health . getDetails ( ) . get ( "zipkin" ) ) ; byte [ ] body = mapper . writer ( ) . writeValueAsBytes ( healthJson ) ; HttpHeaders headers = HttpHeaders . of ( statusMapper . mapStatus ( health . getStatus ( ) ) ) . contentType ( MediaType . JSON ) . setInt ( HttpHeaderNames . CONTENT_LENGTH , body . length ) ; return HttpResponse . of ( headers , HttpData . of ( body ) ) ; }
in future in favour of Actuator endpoints