From e71a13520eae8569751cc881365fe0cfab46c7a5 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Tue, 30 Apr 2019 15:55:22 +0200 Subject: [PATCH] Add sagan .adoc files. --- docs/src/main/asciidoc/sagan-boot.adoc | 0 docs/src/main/asciidoc/sagan-index.adoc | 39 +++++++++++++++++++++++++ 2 files changed, 39 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..456c86a1 --- /dev/null +++ b/docs/src/main/asciidoc/sagan-index.adoc @@ -0,0 +1,39 @@ +Spring Cloud Consul provides http://consul.io[Consul] 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 Hashicorp's Consul. The patterns provided include Service Discovery, Distributed Configuration and Control Bus. + +## Features + +Spring Cloud Consul features: + +* Service Discovery: instances can be registered with the Consul agent 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 the Consul Key/Value store +* Control Bus: Distributed control events using Consul Events + +## Quick Start + +As long as Spring Cloud Consul and the Consul API are on the +classpath any Spring Boot application with `@EnableDiscoveryClient` will try to contact a Consul +agent on `localhost:8500` (the default values of +`spring.cloud.consul.host` and `spring.cloud.consul.port` respectively): + +```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 Consul agent must be running. See the https://consul.io/docs/agent/basics.html[Consul agent documentation] on how to run an agent.