Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

irenical/healthy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Healthy

A ready-to-use LifeCycle that registers and reports health to Consul. It assumes you're using Jindy and that your application is also a LifeCycle with a well implemented isRunning() method.

alt text

Usage

In your application configuration, make sure you have the following properties

my.service.address= node354.mydomain.com #the address your service will be exposed on (defaults to the node's IP)
my.service.port=1337 #the port your service will be exposed on (mandatory). The key is arbitrary
healthy.interval.millis=10000 #the health report interval (defaults to 10000, minimum value=1000)

consul.host=localhost #Consul's host (defaults to localhost)
consul.port=8500 #Consul's port (defaults to 8500)

In your application bootstrap, run the following code

Healthy l = new Healthy(myApp, "myapp", null, "my.service.port");
l.start();