Spring Cloud集群中使用Zuul(十七)
在Eureka集群中使用Zuul 在Spring Cloud中集群中使用Zuul网关,那么Zuul也是集群的一部分,所以它也应该是一个Eureka项目,如图所示,我们搭建一个最简单的集群,通过网关来分发浏览器发起的请求。 依旧是从 Spring Cloud服务管理框架Eureka简单示例(三) 这篇博客底部拿到我们的源码,这三个项目对应我们架构图中底部的三个项目,可以启动三个项目的*App启动类,测试项目是否能够正常使用。 接下来创建eureka-zuul网关项目,作为一个Eureka项目,引入Eureka相关依赖,再加入zuul依赖和httpClient依赖,完整pom.xml的依赖: <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Dalston.SR5</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency>