Class DefaultHealthStatusService

java.lang.Object
io.grpc.health.v1.HealthGrpc.HealthImplBase
org.lognet.springboot.grpc.health.ManagedHealthStatusService
org.lognet.springboot.grpc.health.DefaultHealthStatusService
All Implemented Interfaces:
io.grpc.BindableService, io.grpc.health.v1.HealthGrpc.AsyncService

@GRpcService @Configuration @ConditionalOnMissingBean(ManagedHealthStatusService.class) public class DefaultHealthStatusService extends ManagedHealthStatusService
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    check​(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver<io.grpc.health.v1.HealthCheckResponse> responseObserver)
     
    void
    Invoked on server shutdown.
    void
    setStatus​(String service, io.grpc.health.v1.HealthCheckResponse.ServingStatus status)
    Invoked on startup with HealthCheckResponse.ServingStatus.SERVING for each discovered grpc service name
    Map<String,​io.grpc.health.v1.HealthCheckResponse.ServingStatus>
     
    void
    watch​(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver<io.grpc.health.v1.HealthCheckResponse> responseObserver)
     

    Methods inherited from class io.grpc.health.v1.HealthGrpc.HealthImplBase

    bindService

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultHealthStatusService

      public DefaultHealthStatusService()
  • Method Details

    • onShutdown

      public void onShutdown()
      Description copied from class: ManagedHealthStatusService
      Invoked on server shutdown. Implementation is advised to set status of all services as ServingStatus.NOT_SERVING
      Specified by:
      onShutdown in class ManagedHealthStatusService
    • setStatus

      public void setStatus(String service, io.grpc.health.v1.HealthCheckResponse.ServingStatus status)
      Description copied from class: ManagedHealthStatusService
      Invoked on startup with HealthCheckResponse.ServingStatus.SERVING for each discovered grpc service name
      Specified by:
      setStatus in class ManagedHealthStatusService
      Parameters:
      service - - grpc service name
      status - - new status
    • statuses

      public Map<String,​io.grpc.health.v1.HealthCheckResponse.ServingStatus> statuses()
      Specified by:
      statuses in class ManagedHealthStatusService
    • check

      public void check(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver<io.grpc.health.v1.HealthCheckResponse> responseObserver)
    • watch

      public void watch(io.grpc.health.v1.HealthCheckRequest request, io.grpc.stub.StreamObserver<io.grpc.health.v1.HealthCheckResponse> responseObserver)