Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tbt-post/consul-clj
https://github.com/tbt-post/consul-clj
clj consul-agent microservice tbt-cloud
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tbt-post/consul-clj
- Owner: tbt-post
- Archived: true
- Created: 2020-07-30T12:21:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-14T17:20:24.000Z (about 4 years ago)
- Last Synced: 2024-09-25T19:34:02.747Z (about 2 months ago)
- Topics: clj, consul-agent, microservice, tbt-cloud
- Language: Clojure
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Consul agent client for clojure
Any clojure service can register and send heartbeats to consul agent.
== Start continuous heartbeat
Service will be registered initially.
If consul or third party deregisters service, registration will be renewed"[source,clojure]
----
(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
----== Stop continuous heartbeat
[source,clojure]
----
(stop-heartbeat "my-service")
----== Single hearbeat
Service will be registered if not registered yet.
[source,clojure]
----
(heartbeat {:name "my-service"
:id "[email protected]:8081"
:address "127.0.0.1"
:port 8081
:ttl "15s"
:deregister-critical-service-after "1m"})
----