mut0u / eureka-client

A Clojure client for Netflix Eureka service discovery servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eureka-client

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.

Build Status

Latest release version:

Clojars Project

Usage

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})

Contributing

Contributions are welcome! Please make sure you have added Midje tests for your contribution and lein midje runs fine before sending a pull request.

License

Copyright © 2014 Tobias Bayer

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

A Clojure client for Netflix Eureka service discovery servers

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%