The Apache Software Foundation

Configure Custom Healthchecks

The current project demonstrates how to write custom healthchecks for Apache James. This enables writing new custom healthcheck that fits your monitoring need.

Find this example on GitHub.

Start by importing the dependencies:


You can then start writing your first HealthCheck by implementing HealthCheck interface.

You can compile this example project:

mvn clean install

Then embed your healthcheck into a James server. First configure your custom healthcheck into

# List of fully qualified HealthCheck class names in addition to James' default healthchecks.
# Healthchecks need to be located within the classpath or in the ./extensions-jars folder.

Create a keystore (default password being james72laBalle):

keytool -genkey -alias james -keyalg RSA -keystore keystore

Then start a James server with your JAR and the configuration:

docker run -d \
   -v $PWD/ \
   -v $PWD/healthcheck-extension.jar:/root/extensions-jars \
   -v $PWD/keystore:/root/conf/keystore \
   -p 25:25 \

You can use curl command to get your healthcheck status:

$ curl -XGET