This simple example demonstrates how to use the zookeeper addon to tesla-microservice.
For testing you can run zookeeper locally.
- Download from zookeeper.apache.org and unpack
- start with
bin/zkServer.sh
- connect with
bin/zkCli.sh
- create some data under the path
/foo
withcreate /foo bar
.
- Clone the repo.
- If you are running zookeeper locally,
resources/default.properties
already has a valid connection string:zookeeper.connect=localhost:2181
you can override it with an environment variable:ZOOKEEPER_CONNECT=localhost:2182
. - Start the application with
lein run
. - Access the example service under
http://localhost:8080/example
andhttp://localhost:8080/example/foo
. The latter will report which data, if any, zookeeper has for the path/foo
. - In
bin/zkCli.sh
try changing the data withset /foo baz
and reload the page.
Apache License