通过之前几篇Spring Cloud中几个核心组件的介绍,我们已经可以构建一个简略的(不够完善)微服务架构了。比如下图所示: 我们使用Spring Cloud Netflix中的Eureka实现了服务注册中心以及服务注册与发现;而服务间通过Ribbon或Feign实现服务的消费以及均衡负载;通过Sp ...
分类:
其他好文 时间:
2017-09-15 20:20:29
阅读次数:
279
POM: application.properties 启动类: 启动服务:spring-boot:run或者直接运行启动类 访问:http://localhost:10001/ 能看到控制台 ...
分类:
编程语言 时间:
2017-09-14 23:43:18
阅读次数:
262
http://blog.csdn.net/forezp/article/details/70148833 服务的注册与发现(Eureka) 服务注册(consul) 服务消费者(rest+ribbon)(Feign) 断路器(Hystrix) 路由网关(zuul) 分布式配置中心(Spring Cl ...
分类:
编程语言 时间:
2017-09-14 20:14:35
阅读次数:
122
新建一个spring-boot工程,取名为feign-consumer,在它的pom文件引入Feign的起步依赖spring-cloud-starter-feign、Eureka的起步依赖spring-cloud-starter-eureka、Web的起步依赖spring-boot-starter- ...
分类:
其他好文 时间:
2017-09-13 19:15:31
阅读次数:
187
Spring Cloud Zuul 实现了路由规则与实例的维护问题,通过 Spring Cloud Eureka 进行整合,将自身注册为 Eureka 服务治理下的应用,同时从 Eureka 中获取了所有其他微服务的实例信息,这样的设计非常巧妙的将服务治理体系中维护的实例信息利用起来,使得维护服务实 ...
分类:
编程语言 时间:
2017-09-10 23:52:31
阅读次数:
497
官方文档地址为:http://cloud.spring.io/spring-cloud-static/Dalston.SR3/#spring-cloud-eureka-server 文中例子我做了一些测试在:http://git.oschina.net/dreamingodd/spring-clou ...
分类:
编程语言 时间:
2017-09-08 23:58:06
阅读次数:
604
Spring Cloud Netflix This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environme ...
分类:
编程语言 时间:
2017-09-07 00:03:48
阅读次数:
883
这里不再使用 端口映射的方式,因为不同主机上,Feign 根据 docker hostname访问会有问题. 把打包的好jar copy到docker镜像里 有几个服务,就复制几个dockerfile Dockerfile 开启两个eureka,互相注册 开启两个api服务, 开启两个app服务. ...
分类:
编程语言 时间:
2017-08-27 14:43:15
阅读次数:
1563
如果你的项目使用了SpringCloud微服务技术,那么你就可以使用Feign来作为http客户端来调用远程的http服务。当然,如果你不想使用Feign作为http客户端,也可以使用比如JDK原生的URLConnection、Apache的Http Client、Netty的异步HTTP Clie ...
分类:
编程语言 时间:
2017-08-25 10:55:42
阅读次数:
576
一、容错与回退1.1、容错在SpringCloud中,Zuul默认已经整合了Hystrix。测试:a、依次启动eureka-server(4010)、provide-user(4011)、hystrix-consumer-movie(5012)、microservice-gateway-zuul(5016)、hystrix-dashboard(5013)b、访问http://localhost:5016/hystrix..
分类:
编程语言 时间:
2017-08-24 19:46:37
阅读次数:
2362