Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 64 java ee return Response named successful check up Producers should provide an HTTP endpoint but they can also support protocols such as TCP or Java Management Extensions JMX Requests sent to a producer may be protocol specific but the response should be in JSON format mapped with a proper HTTP status code Status codes with their detailed explanations are shown in Table 1 A sample JSON response is shown in Listing 14 Key value pairs can be defined within the data to provide as much as detail possible Listing 14 outcome UP checks id diskCheck result UP data disk free space 20gb The MicroProfile HealthCheck specification can check on the amount of heap being used excessive garbage collection running out of disk space threads that are deadlocked and so on STATUS CODE DESCRIPTION 200 EXECUTION OF THE CHECK RESULTED IN A POSITIVE OUTCOME 204 NO HEALTH CHECK WAS INSTALLED WITHIN THE RUNTIME 503 EXECUTION OF THE CHECK RESULTED IN A NEGATIVE OUTCOME 500 EXECUTION OF THE CHECK CANNOT BE COMPLETED DUE TO A PROBLEM Table 1 Status codes
You must have JavaScript enabled to view digital editions.