diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index ec849f08d..000000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..6394a40fc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,169 @@
+### Maven template
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+
+# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
+!/.mvn/wrapper/maven-wrapper.jar
+### JetBrains template
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff:
+.idea/
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/dictionaries
+
+# Sensitive or high-churn files:
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.xml
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+
+# Gradle:
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# CMake
+cmake-build-debug/
+
+# Mongo Explorer plugin:
+.idea/**/mongoSettings.xml
+
+## File-based project format:
+*.iws
+
+## Plugin-specific files:
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+### Eclipse template
+
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.recommenders
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+# Code Recommenders
+.recommenders/
+
+# Scala IDE specific (Scala & Java development for Eclipse)
+.cache-main
+.scala_dependencies
+.worksheet
+
+chapter1/.DS_Store
+chapter3/.DS_Store
+### Windows template
+# Windows thumbnail cache files
+Thumbs.db
+ehthumbs.db
+ehthumbs_vista.db
+
+# Dump file
+*.stackdump
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+### macOS template
+# General
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+.DS_Store
diff --git a/chapter1/chapter1.iml b/chapter1/chapter1.iml
deleted file mode 100755
index 8d8ffd981..000000000
--- a/chapter1/chapter1.iml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/chapter1/eureka-server/pom.xml b/chapter1/eureka-server/pom.xml
index c2d69ca8a..0caf76701 100755
--- a/chapter1/eureka-server/pom.xml
+++ b/chapter1/eureka-server/pom.xml
@@ -28,6 +28,7 @@
org.springframework.cloud
spring-cloud-starter-eureka-server
+ 1.3.5.RELEASE
@@ -42,7 +43,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -58,16 +59,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter1/service-hi/pom.xml b/chapter1/service-hi/pom.xml
index 8befb8b2d..8bd89aea9 100755
--- a/chapter1/service-hi/pom.xml
+++ b/chapter1/service-hi/pom.xml
@@ -46,7 +46,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -62,16 +62,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter10/eureka-server/pom.xml b/chapter10/eureka-server/pom.xml
index c2d69ca8a..9ce8ed89f 100755
--- a/chapter10/eureka-server/pom.xml
+++ b/chapter10/eureka-server/pom.xml
@@ -42,7 +42,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -58,16 +58,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter10/service-hi/pom.xml b/chapter10/service-hi/pom.xml
index 8befb8b2d..8bd89aea9 100755
--- a/chapter10/service-hi/pom.xml
+++ b/chapter10/service-hi/pom.xml
@@ -46,7 +46,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -62,16 +62,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter11/eureka-server/pom.xml b/chapter11/eureka-server/pom.xml
index 01836f44d..5754c411d 100755
--- a/chapter11/eureka-server/pom.xml
+++ b/chapter11/eureka-server/pom.xml
@@ -43,7 +43,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -60,15 +60,17 @@
com.spotify
docker-maven-plugin
- 0.4.3
+ 0.4.13
${docker.image.prefix}/${project.artifactId}
src/main/docker
+
/
${project.build.directory}
${project.build.finalName}.jar
+ eureka-server-0.0.1-SNAPSHOT.jar.original
@@ -77,16 +79,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter11/service-hi/pom.xml b/chapter11/service-hi/pom.xml
index 8729f577e..844f7731f 100755
--- a/chapter11/service-hi/pom.xml
+++ b/chapter11/service-hi/pom.xml
@@ -47,7 +47,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -64,7 +64,7 @@
com.spotify
docker-maven-plugin
- 0.4.3
+ 0.4.13
${docker.image.prefix}/${project.artifactId}
src/main/docker
@@ -81,14 +81,14 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter11/service-hi/src/main/java/com/forezp/ServiceHiApplication.java b/chapter11/service-hi/src/main/java/com/forezp/ServiceHiApplication.java
index b5745d783..d41d06cea 100755
--- a/chapter11/service-hi/src/main/java/com/forezp/ServiceHiApplication.java
+++ b/chapter11/service-hi/src/main/java/com/forezp/ServiceHiApplication.java
@@ -8,6 +8,11 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 192.168.2.109为宿主机ip
+ * docker run -itd --add-host eureka-server:192.168.2.109 -p 8763:8763 -t forezp/service-hi
+ */
@SpringBootApplication
@EnableEurekaClient
@RestController
diff --git a/chapter13/service-hi/pom.xml b/chapter13/service-hi/pom.xml
index 353a5efe4..aacad85fa 100755
--- a/chapter13/service-hi/pom.xml
+++ b/chapter13/service-hi/pom.xml
@@ -59,7 +59,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -75,16 +75,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter13/service-lucy/pom.xml b/chapter13/service-lucy/pom.xml
index cab4d74f9..343788c8d 100755
--- a/chapter13/service-lucy/pom.xml
+++ b/chapter13/service-lucy/pom.xml
@@ -60,7 +60,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RELEASE
+ Dalston.SR4
pom
import
diff --git a/chapter13/service-turbine/pom.xml b/chapter13/service-turbine/pom.xml
index 24c69aa25..09694d31c 100755
--- a/chapter13/service-turbine/pom.xml
+++ b/chapter13/service-turbine/pom.xml
@@ -50,7 +50,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RELEASE
+ Dalston.SR4
pom
import
diff --git a/chapter2/service-hi/pom.xml b/chapter2/service-hi/pom.xml
index 8befb8b2d..8bd89aea9 100755
--- a/chapter2/service-hi/pom.xml
+++ b/chapter2/service-hi/pom.xml
@@ -46,7 +46,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -62,16 +62,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter2/service-ribbon/pom.xml b/chapter2/service-ribbon/pom.xml
index 632667ff2..71b6f0186 100755
--- a/chapter2/service-ribbon/pom.xml
+++ b/chapter2/service-ribbon/pom.xml
@@ -50,7 +50,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -66,16 +66,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter3/service-feign/pom.xml b/chapter3/service-feign/pom.xml
index e59837abb..cf03b69ec 100755
--- a/chapter3/service-feign/pom.xml
+++ b/chapter3/service-feign/pom.xml
@@ -50,7 +50,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -66,16 +66,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter3/service-feign/src/main/java/com/forezp/service/SchedualServiceHi.java b/chapter3/service-feign/src/main/java/com/forezp/service/SchedualServiceHi.java
index 04ac845b6..3b79dfc5e 100755
--- a/chapter3/service-feign/src/main/java/com/forezp/service/SchedualServiceHi.java
+++ b/chapter3/service-feign/src/main/java/com/forezp/service/SchedualServiceHi.java
@@ -10,6 +10,7 @@
*/
@FeignClient(value = "service-hi")
public interface SchedualServiceHi {
+
@RequestMapping(value = "/hi",method = RequestMethod.GET)
String sayHiFromClientOne(@RequestParam(value = "name") String name);
}
diff --git a/chapter3/service-hi/src/main/resources/bootstrap.yml b/chapter3/service-hi/src/main/resources/bootstrap.yml
index 2cc9eae09..2a743133e 100755
--- a/chapter3/service-hi/src/main/resources/bootstrap.yml
+++ b/chapter3/service-hi/src/main/resources/bootstrap.yml
@@ -3,7 +3,7 @@ eureka:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
server:
- port: 8762
+ port: 8763
spring:
application:
name: service-hi
\ No newline at end of file
diff --git a/chapter4/service-feign/pom.xml b/chapter4/service-feign/pom.xml
index e59837abb..cf03b69ec 100755
--- a/chapter4/service-feign/pom.xml
+++ b/chapter4/service-feign/pom.xml
@@ -50,7 +50,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -66,16 +66,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter4/service-feign/src/main/resources/application.yml b/chapter4/service-feign/src/main/resources/application.yml
index f8601be7e..d2337f929 100755
--- a/chapter4/service-feign/src/main/resources/application.yml
+++ b/chapter4/service-feign/src/main/resources/application.yml
@@ -6,4 +6,7 @@ server:
port: 8765
spring:
application:
- name: service-feign
\ No newline at end of file
+ name: service-feign
+feign:
+ hystrix:
+ enabled: true
\ No newline at end of file
diff --git a/chapter4/service-ribbon/pom.xml b/chapter4/service-ribbon/pom.xml
index 019acd1f8..b3c640bb9 100755
--- a/chapter4/service-ribbon/pom.xml
+++ b/chapter4/service-ribbon/pom.xml
@@ -64,7 +64,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -80,16 +80,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter5/eureka-server/pom.xml b/chapter5/eureka-server/pom.xml
index c2d69ca8a..5d5c3c303 100755
--- a/chapter5/eureka-server/pom.xml
+++ b/chapter5/eureka-server/pom.xml
@@ -42,7 +42,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
diff --git a/chapter5/service-feign/pom.xml b/chapter5/service-feign/pom.xml
index e59837abb..3de1eaf5f 100755
--- a/chapter5/service-feign/pom.xml
+++ b/chapter5/service-feign/pom.xml
@@ -50,7 +50,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
diff --git a/chapter5/service-hi/pom.xml b/chapter5/service-hi/pom.xml
index 8befb8b2d..4cca4b71c 100755
--- a/chapter5/service-hi/pom.xml
+++ b/chapter5/service-hi/pom.xml
@@ -46,7 +46,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
diff --git a/chapter5/service-hi/src/main/resources/bootstrap.yml b/chapter5/service-hi/src/main/resources/bootstrap.yml
index 2cc9eae09..2a743133e 100755
--- a/chapter5/service-hi/src/main/resources/bootstrap.yml
+++ b/chapter5/service-hi/src/main/resources/bootstrap.yml
@@ -3,7 +3,7 @@ eureka:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
server:
- port: 8762
+ port: 8763
spring:
application:
name: service-hi
\ No newline at end of file
diff --git a/chapter5/service-ribbon/pom.xml b/chapter5/service-ribbon/pom.xml
index 019acd1f8..364cbd1ae 100755
--- a/chapter5/service-ribbon/pom.xml
+++ b/chapter5/service-ribbon/pom.xml
@@ -64,7 +64,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
diff --git a/chapter5/service-zuul/pom.xml b/chapter5/service-zuul/pom.xml
index bff6d28c6..194d7f5fc 100755
--- a/chapter5/service-zuul/pom.xml
+++ b/chapter5/service-zuul/pom.xml
@@ -50,7 +50,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -66,16 +66,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter5/service-zuul/src/main/java/com/forezp/RateLimitZuulFilter.java b/chapter5/service-zuul/src/main/java/com/forezp/RateLimitZuulFilter.java
new file mode 100644
index 000000000..eb3b3101c
--- /dev/null
+++ b/chapter5/service-zuul/src/main/java/com/forezp/RateLimitZuulFilter.java
@@ -0,0 +1,94 @@
+package com.forezp;
+
+import com.google.common.collect.Maps;
+import com.google.common.util.concurrent.RateLimiter;
+import com.netflix.zuul.ZuulFilter;
+import com.netflix.zuul.context.RequestContext;
+import com.netflix.zuul.exception.ZuulException;
+import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants;
+import org.springframework.core.Ordered;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ReflectionUtils;
+
+import javax.servlet.http.HttpServletResponse;
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * Created by user on 2019/2/24
+ * refer http://www.itmuch.com/spring-cloud-sum/spring-cloud-ratelimit/
+ */
+@Component
+public class RateLimitZuulFilter extends ZuulFilter {
+
+ private static final String SERVICE_ID_KEY = "serviceId";
+ public static final double PERMITS_PER_SECOND = 3;
+ public static final double PERMITS_PER_SECOND1 = 2;
+ private Map map = Maps.newConcurrentMap();
+
+ @Override
+ public String filterType() {
+ return FilterConstants.PRE_TYPE;
+ }
+
+ @Override
+ public int filterOrder() {
+ // 这边的order一定要大于org.springframework.cloud.netflix.zuul.filters.pre.PreDecorationFilter的order
+ // 也就是要大于5
+ // 否则,RequestContext.getCurrentContext()里拿不到serviceId等数据。
+ return Ordered.LOWEST_PRECEDENCE;
+ }
+
+ @Override
+ public boolean shouldFilter() {
+ // 这里可以考虑弄个限流开启的开关,开启限流返回true,关闭限流返回false,你懂的。
+ return true;
+ }
+
+ @Override
+ public Object run() {
+ try {
+ RequestContext context = RequestContext.getCurrentContext();
+ HttpServletResponse response = context.getResponse();
+
+ String key = null;
+ // 对于service格式的路由,走RibbonRoutingFilter
+ String serviceId = (String) context.get(SERVICE_ID_KEY);
+ if (serviceId != null) {
+ key = serviceId;
+ map.putIfAbsent(serviceId, RateLimiter.create(PERMITS_PER_SECOND));
+ }
+ // 如果压根不走RibbonRoutingFilter,则认为是URL格式的路由
+ else {
+ // 对于URL格式的路由,走SimpleHostRoutingFilter
+ URL routeHost = context.getRouteHost();
+ if (routeHost != null) {
+ String url = routeHost.toString();
+ key = url;
+ map.putIfAbsent(url, RateLimiter.create(PERMITS_PER_SECOND1));
+ }
+ }
+ RateLimiter rateLimiter = map.get(key);
+ if (!rateLimiter.tryAcquire()) {
+ HttpStatus httpStatus = HttpStatus.TOO_MANY_REQUESTS;
+
+ response.setContentType(MediaType.TEXT_PLAIN_VALUE);
+ response.setStatus(httpStatus.value());
+ response.getWriter().append(httpStatus.getReasonPhrase());
+
+ context.setSendZuulResponse(false);
+
+ throw new ZuulException(
+ httpStatus.getReasonPhrase(),
+ httpStatus.value(),
+ httpStatus.getReasonPhrase()
+ );
+ }
+ } catch (Exception e) {
+ ReflectionUtils.rethrowRuntimeException(e);
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/chapter5/service-zuul/src/main/java/com/forezp/RateLimitZuulFilterAll.java b/chapter5/service-zuul/src/main/java/com/forezp/RateLimitZuulFilterAll.java
new file mode 100644
index 000000000..e6a358e64
--- /dev/null
+++ b/chapter5/service-zuul/src/main/java/com/forezp/RateLimitZuulFilterAll.java
@@ -0,0 +1,66 @@
+package com.forezp;
+
+import com.google.common.util.concurrent.RateLimiter;
+import com.netflix.zuul.ZuulFilter;
+import com.netflix.zuul.context.RequestContext;
+import com.netflix.zuul.exception.ZuulException;
+import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants;
+import org.springframework.core.Ordered;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ReflectionUtils;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Created by user on 2019/2/24
+ * 这种是整体限流,经过zuul低下的所有微服务都是同一个限制条件
+ */
+//@Component
+public class RateLimitZuulFilterAll extends ZuulFilter {
+
+ private final RateLimiter rateLimiter = RateLimiter.create(2.0);
+
+ @Override
+ public String filterType() {
+ return FilterConstants.PRE_TYPE;
+ }
+
+ @Override
+ public int filterOrder() {
+ return Ordered.HIGHEST_PRECEDENCE;
+ }
+
+ @Override
+ public boolean shouldFilter() {
+ // 这里可以考虑弄个限流开启的开关,开启限流返回true,关闭限流返回false,你懂的。
+ return true;
+ }
+
+ @Override
+ public Object run() {
+ try {
+ RequestContext currentContext = RequestContext.getCurrentContext();
+ HttpServletResponse response = currentContext.getResponse();
+ if (!rateLimiter.tryAcquire()) {
+ HttpStatus httpStatus = HttpStatus.TOO_MANY_REQUESTS;
+
+ response.setContentType(MediaType.TEXT_PLAIN_VALUE);
+ response.setStatus(httpStatus.value());
+ response.getWriter().append(httpStatus.getReasonPhrase());
+
+ currentContext.setSendZuulResponse(false);
+
+ throw new ZuulException(
+ httpStatus.getReasonPhrase(),
+ httpStatus.value(),
+ httpStatus.getReasonPhrase()
+ );
+ }
+ } catch (Exception e) {
+ ReflectionUtils.rethrowRuntimeException(e);
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/chapter5/service-zuul/src/main/java/com/forezp/ServiceZuulApplication.java b/chapter5/service-zuul/src/main/java/com/forezp/ServiceZuulApplication.java
index 8defe94c9..f17140df5 100755
--- a/chapter5/service-zuul/src/main/java/com/forezp/ServiceZuulApplication.java
+++ b/chapter5/service-zuul/src/main/java/com/forezp/ServiceZuulApplication.java
@@ -7,6 +7,9 @@
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
+/**
+ * refer https://www.fangzhipeng.com/springcloud/2017/06/05/sc05-zuul.html
+ */
@EnableZuulProxy
@EnableEurekaClient
@SpringBootApplication
diff --git a/chapter6/config-client/pom.xml b/chapter6/config-client/pom.xml
index 7642f9195..5a15b586c 100755
--- a/chapter6/config-client/pom.xml
+++ b/chapter6/config-client/pom.xml
@@ -47,7 +47,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -63,16 +63,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter6/config-server/pom.xml b/chapter6/config-server/pom.xml
index 69cc644f6..eef038642 100755
--- a/chapter6/config-server/pom.xml
+++ b/chapter6/config-server/pom.xml
@@ -47,7 +47,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Camden.SR6
+ Dalston.SR4
pom
import
@@ -64,16 +64,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter7/config-client/pom.xml b/chapter7/config-client/pom.xml
index f04efc3d5..6ee302694 100755
--- a/chapter7/config-client/pom.xml
+++ b/chapter7/config-client/pom.xml
@@ -51,7 +51,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -67,16 +67,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter7/config-server/pom.xml b/chapter7/config-server/pom.xml
index 69cc644f6..eef038642 100755
--- a/chapter7/config-server/pom.xml
+++ b/chapter7/config-server/pom.xml
@@ -47,7 +47,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Camden.SR6
+ Dalston.SR4
pom
import
@@ -64,16 +64,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter7/config-server/src/main/resources/application.properties b/chapter7/config-server/src/main/resources/application.properties
index e4fa3b1fe..6c382d6c7 100755
--- a/chapter7/config-server/src/main/resources/application.properties
+++ b/chapter7/config-server/src/main/resources/application.properties
@@ -1,7 +1,7 @@
spring.application.name=config-server
server.port=8888
-spring.cloud.config.server.git.uri=https://github.com/forezp/SpringcloudConfig/
+spring.cloud.config.server.git.uri=https://github.com/Incoding/SpringCloudLearning
spring.cloud.config.server.git.searchPaths=respo
spring.cloud.config.label=master
spring.cloud.config.server.git.username= your username
diff --git a/chapter7/eureka-server/pom.xml b/chapter7/eureka-server/pom.xml
index 9dba9016f..621a4180d 100755
--- a/chapter7/eureka-server/pom.xml
+++ b/chapter7/eureka-server/pom.xml
@@ -46,7 +46,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -62,16 +62,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter8/config-client/pom.xml b/chapter8/config-client/pom.xml
index 8866ed391..eda216d5d 100755
--- a/chapter8/config-client/pom.xml
+++ b/chapter8/config-client/pom.xml
@@ -70,7 +70,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -86,16 +86,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter8/config-client/src/main/resources/bootstrap.properties b/chapter8/config-client/src/main/resources/bootstrap.properties
index 336c313dd..46b893497 100755
--- a/chapter8/config-client/src/main/resources/bootstrap.properties
+++ b/chapter8/config-client/src/main/resources/bootstrap.properties
@@ -9,6 +9,9 @@ spring.cloud.config.discovery.enabled=true
spring.cloud.config.discovery.serviceId=config-server
management.security.enabled=false
+
+#run -d -v /Users/user/share/docker/rabbitmq:/var/lib/rabbitmq -p 5672:5672 --hostname localhost --name rabbit rabbitmq:3.6.12
+#curl -XPOST http://localhost:8881/bus/refresh
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
diff --git a/chapter9/server-zipkin/pom.xml b/chapter9/server-zipkin/pom.xml
index 131a3b6c7..a4ef6b297 100755
--- a/chapter9/server-zipkin/pom.xml
+++ b/chapter9/server-zipkin/pom.xml
@@ -57,7 +57,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Camden.SR6
+ Dalston.SR4
pom
import
diff --git a/chapter9/service-hi/pom.xml b/chapter9/service-hi/pom.xml
index 6ffbd35dc..ab21d3936 100755
--- a/chapter9/service-hi/pom.xml
+++ b/chapter9/service-hi/pom.xml
@@ -49,7 +49,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -65,16 +65,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter9/service-miya/pom.xml b/chapter9/service-miya/pom.xml
index 8eb8a26a5..2295d8dde 100755
--- a/chapter9/service-miya/pom.xml
+++ b/chapter9/service-miya/pom.xml
@@ -50,7 +50,7 @@
org.springframework.cloud
spring-cloud-dependencies
- Dalston.RC1
+ Dalston.SR4
pom
import
@@ -66,16 +66,16 @@
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
- false
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/chapter9/service-miya/src/main/java/com/forezp/ServiceMiyaApplication.java b/chapter9/service-miya/src/main/java/com/forezp/ServiceMiyaApplication.java
index 4aa60d43d..2cfe3af49 100755
--- a/chapter9/service-miya/src/main/java/com/forezp/ServiceMiyaApplication.java
+++ b/chapter9/service-miya/src/main/java/com/forezp/ServiceMiyaApplication.java
@@ -11,6 +11,10 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+/**
+ * curl http://localhost:8988/hi dependences show
+ * curl http://localhost:8989/miya dependences don't show
+ */
@SpringBootApplication
@RestController
public class ServiceMiyaApplication {
diff --git a/respo/config-client-dev.properties b/respo/config-client-dev.properties
index 36d8a9f49..eef7b19cf 100755
--- a/respo/config-client-dev.properties
+++ b/respo/config-client-dev.properties
@@ -1,5 +1,5 @@
-foo = foo version 3
+foo = foo version 5
democonfigclient.message=hello spring io
# routes to serviceId