Spring Cloud Netflix provides Netflix OSS 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 battle-tested Netflix components. The patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix), Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon)..
Spring Cloud Netflix features:
As long as Spring Cloud Netflix and Eureka Core are on the
classpath any Spring Boot application with @EnableEurekaClient
will try to contact a Eureka
server on http://localhost:8761
(the default value of
eureka.client.serviceUrl.defaultZone
):
@Configuration
@EnableAutoConfiguration
@EnableEurekaClient
@RestController
public class Application {
@RequestMapping("/")
public String home() {
return "Hello World";
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
To run your own server use the spring-cloud-starter-eureka-server
dependency and @EnableEurekaServer
.