Any clojure service can register and send heartbeats to consul agent.
Service will be registered initially. If consul or third party deregisters service, registration will be renewed"
(start-heartbeat {:name "my-service" ; service name, required
:id "[email protected]:8081" ; id must be unique for agent, defaults to service name
:address "127.0.0.1" ; service remote address
:port 8081
:ttl "15s" ; timeout since last heartbeat to set critical state
:deregister-critical-service-after "1m" ; timeout for consul to deregister service in critical state
:interval-ms 7500}) ; heartbeat interval, milliseconds
Service will be registered if not registered yet.
(heartbeat {:name "my-service"
:id "[email protected]:8081"
:address "127.0.0.1"
:port 8081
:ttl "15s"
:deregister-critical-service-after "1m"})