This bundle adds a healthcheck which can used to take the application out of rotation from a loadbalancer which uses /healthcheck endpoint for healthchecks This bundle compiles only on Java 17.
This makes it easier perform rolling deployments & maintenance of dropwizard applications
-
Clone the source:
git clone github.com/phaneesh/dropwizard-oor
-
Build
mvn install
- Use the following maven dependency:
<dependency>
<groupId>com.github.phaneesh</groupId>
<artifactId>dropwizard-oor</artifactId>
<version>3.0.7-1</version>
</dependency>
@Override
public void initialize(final Bootstrap...) {
bootstrap.addBundle(new OorBundle() {
public boolean withOor() {
return false;
}
});
}
curl -XPOST http://host:adminport/tasks/oor
for taking node out of rotationcurl -XPOST http://host:adminport/tasks/bir
for bringing node back into rotation
Please allow the node to run for the grace period and a bit more that you have configured in your load balancer healthchecks so that the load balancer can drain all the requests gracefully.