From 1ed80350fe381c4e73fa797741f5ec319db22073 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 29 Apr 2019 13:25:13 +0400 Subject: [PATCH] Added sagan pages; fixes gh-229 --- docs/src/main/asciidoc/sagan-boot.adoc | 0 docs/src/main/asciidoc/sagan-index.adoc | 36 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 docs/src/main/asciidoc/sagan-boot.adoc create mode 100644 docs/src/main/asciidoc/sagan-index.adoc diff --git a/docs/src/main/asciidoc/sagan-boot.adoc b/docs/src/main/asciidoc/sagan-boot.adoc new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/main/asciidoc/sagan-index.adoc b/docs/src/main/asciidoc/sagan-index.adoc new file mode 100644 index 00000000..8d3ac789 --- /dev/null +++ b/docs/src/main/asciidoc/sagan-index.adoc @@ -0,0 +1,36 @@ +Spring Cloud Zookeeper provides http://zookeeper.apache.org/[Apache Zookeeper] integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environment and other Spring programming model idioms. With a few simple annotations you can quickly enable and configure the common patterns inside your application and build large distributed systems with Zookeeper. The patterns provided include Service Discovery and Distributed Configuration. + +## Features + +* Service Discovery: instances can be registered with Zookeeper and clients can discover the instances using Spring-managed beans + * Supports Ribbon, the client side load-balancer via Spring Cloud Netflix + * Supports Zuul, a dynamic router and filter via Spring Cloud Netflix +* Distributed Configuration: using Zookeeper as a data store + +## Quick Start + +As long as Spring Cloud Zookeeper, http://curator.apache.org/[Apache Curator] and the Zookeeper Java Client are on the +classpath any Spring Boot application with `@EnableDiscoveryClient` will try to contact a Zookeeper +agent on `localhost:2181` (the default value of +`zookeeper.connectString`). + +```java +@Configuration +@EnableAutoConfiguration +@EnableDiscoveryClient +@RestController +public class Application { + + @RequestMapping("/") + public String home() { + return "Hello World"; + } + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} +``` + +A local Zookeeper server must be running. See the http://zookeeper.apache.org/doc/trunk/zookeeperStarted.html[Zookeeper documentation] on how to run a Zookeeper server.