Spring Cloud Netflix 2.2.3

本文介绍如何使用SpringCloud Netflix快速构建分布式系统,包括服务发现、断路器、智能路由等功能。通过简单的注解即可实现Eureka服务注册与发现、Hystrix断路器、Feign REST客户端等组件的配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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)…
Features

Spring Cloud Netflix features:

Service Discovery: Eureka instances can be registered and clients can discover the instances using Spring-managed beans

Service Discovery: an embedded Eureka server can be created with declarative Java configuration

Circuit Breaker: Hystrix clients can be built with a simple annotation-driven method decorator

Circuit Breaker: embedded Hystrix dashboard with declarative Java configuration

Declarative REST Client: Feign creates a dynamic implementation of an interface decorated with JAX-RS or Spring MVC annotations

Client Side Load Balancer: Ribbon

External Configuration: a bridge from the Spring Environment to Archaius (enables native configuration of Netflix components using Spring Boot conventions)

Router and Filter: automatic regsitration of Zuul filters, and a simple convention over configuration approach to reverse proxy creation

Getting Started

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

@SpringBootApplication
@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-netflix-eureka-server dependency and @EnableEurekaServer.
Quick start
Bootstrap your application with Spring Initializr.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值