Spring Cloud Consul 2.2.3

Spring Cloud Consul provides 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 Spring Cloud LoadBalancer - a client side load-balancer provided by the Spring Cloud project

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

@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 Consul agent documentation on how to run an agent.
Quick start
Bootstrap your application with Spring Initializr.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值