This library aims to be a Clojure client for Netflix' Eureka service registry. At the moment registering an app and sending heartbeats is supported. Instances of an app can be retrieved.
Latest release version:
Include eureka-client as a dependency in your project.clj
:
[eureka-client "0.2.0"]
To build from source, run the following commands:
lein deps
lein install
Register your service "my-service-name" with port 10100 at the Eureka server at localhost:8761 like this:
(ns your.name.space
(:require [eureka-client.core :as eureka]))
(eureka/register "localhost" 8761 "my-service-name" 10100)
After registering, a heartbeat will automatically be sent every 20 seconds.
Request all instances for "my-service-name" (after two instances have been registered):
(eureka/find-instances "localhost" 8761 "my-service-name")
; => '({:ip "192.168.178.38" :port 10100} {:ip "192.168.178.38" :port 11100})
Contributions are welcome!
Please make sure you have added Midje tests for your contribution and lein midje
runs fine before sending a pull request.
Copyright © 2014 Tobias Bayer
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.