Skip to content

Commit

Permalink
Fixed loglevel readiness service
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-axual committed Sep 24, 2024
1 parent dff27d7 commit 8aadfd5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ public Response getReadyState() {

if (querier == null) {
// Service has not started yet
log.info("KSML Not Ready -No querier available, still in startup");
log.trace("KSML Not Ready -No querier available, still in startup");
return Response.serverError().build();
}

final var producerState = querier.getProducerState();
final var streamRunnerState = querier.getStreamRunnerState();

if (producerState == NOT_APPLICABLE && streamRunnerState == NOT_APPLICABLE) {
log.info("KSML Not Ready - Both producerState and streamRunnerState are disabled");
log.trace("KSML Not Ready - Both producerState and streamRunnerState are disabled");
return Response.serverError().build();
}

if (PRODUCER_READY_STATES.contains(producerState) && STREAMS_READY_STATES.contains(streamRunnerState)) {
// KSML is running, return HTTP Status code 204 (OK, No Content) if components
log.info("KSML Ready - producer state '{}' stream runner state '{}' ", producerState, streamRunnerState);
log.trace("KSML Ready - producer state '{}' stream runner state '{}' ", producerState, streamRunnerState);
return Response.noContent().build();
} else {
log.info("KSML Not Ready - producer state '{}' stream runner state '{}' ", producerState, streamRunnerState);
log.trace("KSML Not Ready - producer state '{}' stream runner state '{}' ", producerState, streamRunnerState);
return Response.serverError().build();
}
}
Expand Down

0 comments on commit 8aadfd5

Please sign in to comment.