Skip to content

Commit

Permalink
service - health
Browse files Browse the repository at this point in the history
  • Loading branch information
surabhi-mahawar committed Aug 8, 2022
1 parent 25be2d6 commit 4ce4212
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/com/uci/outbound/health/ServiceStatusController.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ public class ServiceStatusController {
@Autowired
private HealthService healthService;

/**
* In use by sunbird team - to check service liveliness & readliness
* @return
* @throws JsonProcessingException
*/
@RequestMapping(value = "/health", method = RequestMethod.GET, produces = { "application/json", "text/json" })
public ResponseEntity<ApiResponse> statusCheck() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
JsonNode resultNode = mapper.readTree("{\"healthy\":true}");

ApiResponse response = ApiResponse.builder()
.id("api.service.health.cassandra")
.params(ApiResponseParams.builder().build())
.responseCode(HttpStatus.OK.name())
.result(resultNode)
.build();

return ResponseEntity.ok(response);
}

@RequestMapping(value = "/health/cassandra", method = RequestMethod.GET, produces = { "application/json", "text/json" })
public ResponseEntity<ApiResponse> cassandraStatusCheck() throws IOException, JsonProcessingException {
ApiResponse response = ApiResponse.builder()
Expand Down

0 comments on commit 4ce4212

Please sign in to comment.