Health Checker: Java Embedded Server

Modern Cloud Services need to have health checkers. Even some shared libraries might make sense to have health checkers. There is a lot of debate in the community on how the health checker should be implemented. If should just return dummy 200 hardcoded or if should check all dependencies of the services like database connections and other essential downstream dependencies. Which would require us to have a background thread in order to do it in a sane way. IMHO both can work. If you have observability into the other components is not required to make the service look all that, if you dont have or dont have to control to add it, it might be a good idea to have on the service. Besides health checkers, I believe we need to have greater Observability in Services and even for some shared libraries and we should collect metrics and expose config values other key aspects. IF you already have a service let's say running Spring Boot(Tomcat or Netty) or Quarkus, you already have a service. However if you are doing a library you might not have a service, you really do not want to add that dependency, so there is a way to fix that by using the default JDK HTTP Server. 

The Video


The Code


Cheers,
Diego Pacheco

Popular posts from this blog

Podman in Linux

Java Agents

HMAC in Java