当前位置:   article > 正文

springcloud(五)_discoveryclient_product/localhost:product:8090 - w

discoveryclient_product/localhost:product:8090 - was unable to refresh its c

背景:基于springcloud(四)基础进行

服务熔断

一、ribbon消费者

1. 在spring-cloud-ribbon工程中 添加依赖

  1. <dependency>
  2. <groupId>org.springframework.cloud</groupId>
  3. <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
  4. </dependency>

2. 引导类RibbonApplication中添加注解@EnableHystrix,修改后的内容如下

  1. package com.zsx;
  2. import org.springframework.boot.SpringApplication;
  3. import org.springframework.boot.autoconfigure.SpringBootApplication;
  4. import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  5. import org.springframework.cloud.netflix.hystrix.EnableHystrix;
  6. @SpringBootApplication
  7. @EnableDiscoveryClient
  8. @EnableHystrix
  9. public class RibbonApplication {
  10. public static void main(String[] args) {
  11. SpringApplication.run(RibbonApplication.class, args);
  12. }
  13. }

3. RibbonTestService类中方法添加注解@HystrixCommand及对应方法

  1. package com.zsx.service;
  2. import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Service;
  5. import org.springframework.web.client.RestTemplate;
  6. @Service
  7. public class RibbonTestService {
  8. @Autowired
  9. private RestTemplate restTemplate;
  10. @HystrixCommand(fallbackMethod = "getError")
  11. public String get(String message) {
  12. return restTemplate.getForObject("http://SPRING-CLOUD-EUREKA-CLIENT/api/v1/test/" + message, String.class);
  13. }
  14. public String getError(String message) {
  15. return "Failed to get message";
  16. }
  17. }

4. 启动服务注册中心与ribbon消费者

5. 查看服务注册中心

6. 查看消费者http://localhost:8084/ribbon/hello

到此ribbon熔断器配置完成

二、Feign消费者

1. 在spring-cloud-feign工程的application.yml配置文件中添加feign熔断器配置

  1. feign:
  2. hystrix:
  3. enabled: true

修改后的内容如下

  1. server:
  2. port: 8085
  3. spring:
  4. application:
  5. name: spring-cloud-feign
  6. feign:
  7. hystrix:
  8. enabled: true
  9. eureka:
  10. client:
  11. serviceUrl:
  12. defaultZone: http://localhost:8081/eureka/

2. 在FeignTestService接口上添加fallback回调

  1. package com.zsx.service;
  2. import com.zsx.hystrix.FeignTestHystrix;
  3. import org.springframework.cloud.openfeign.FeignClient;
  4. import org.springframework.web.bind.annotation.GetMapping;
  5. import org.springframework.web.bind.annotation.PathVariable;
  6. @FeignClient(value = "spring-cloud-eureka-client", fallback = FeignTestHystrix.class)
  7. public interface FeignTestService {
  8. @GetMapping(value = "/api/v1/test/{message}")
  9. String get(@PathVariable("message") String message);
  10. }

3. 将熔断器添加到容器

  1. package com.zsx.hystrix;
  2. import com.zsx.service.FeignTestService;
  3. import org.springframework.stereotype.Component;
  4. @Component
  5. public class FeignTestHystrix implements FeignTestService {
  6. @Override
  7. public String get(String message) {
  8. return "Failed to get message";
  9. }
  10. }

4. 启动注册中心、Feign消费者

  1. C:\software\jdk-11.0.3\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:C:\software\JetBrains\IntelliJ IDEA 2019.1.3\lib\idea_rt.jar=6883:C:\software\JetBrains\IntelliJ IDEA 2019.1.3\bin" -Dfile.encoding=UTF-8 -classpath F:\IdeaProjects\spring-cloud\spring-cloud-feign\target\classes;D:\repository\org\springframework\cloud\spring-cloud-starter-openfeign\2.1.2.RELEASE\spring-cloud-starter-openfeign-2.1.2.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-starter\2.1.2.RELEASE\spring-cloud-starter-2.1.2.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-context\2.1.2.RELEASE\spring-cloud-context-2.1.2.RELEASE.jar;D:\repository\org\springframework\security\spring-security-rsa\1.0.7.RELEASE\spring-security-rsa-1.0.7.RELEASE.jar;D:\repository\org\bouncycastle\bcpkix-jdk15on\1.60\bcpkix-jdk15on-1.60.jar;D:\repository\org\bouncycastle\bcprov-jdk15on\1.60\bcprov-jdk15on-1.60.jar;D:\repository\org\springframework\cloud\spring-cloud-openfeign-core\2.1.2.RELEASE\spring-cloud-openfeign-core-2.1.2.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-netflix-ribbon\2.1.2.RELEASE\spring-cloud-netflix-ribbon-2.1.2.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-aop\2.1.6.RELEASE\spring-boot-starter-aop-2.1.6.RELEASE.jar;D:\repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;D:\repository\io\github\openfeign\form\feign-form-spring\3.8.0\feign-form-spring-3.8.0.jar;D:\repository\io\github\openfeign\form\feign-form\3.8.0\feign-form-3.8.0.jar;D:\repository\commons-fileupload\commons-fileupload\1.4\commons-fileupload-1.4.jar;D:\repository\commons-io\commons-io\2.2\commons-io-2.2.jar;D:\repository\org\springframework\spring-web\5.1.8.RELEASE\spring-web-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-commons\2.1.2.RELEASE\spring-cloud-commons-2.1.2.RELEASE.jar;D:\repository\org\springframework\security\spring-security-crypto\5.1.5.RELEASE\spring-security-crypto-5.1.5.RELEASE.jar;D:\repository\io\github\openfeign\feign-core\10.2.3\feign-core-10.2.3.jar;D:\repository\io\github\openfeign\feign-slf4j\10.2.3\feign-slf4j-10.2.3.jar;D:\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;D:\repository\io\github\openfeign\feign-hystrix\10.2.3\feign-hystrix-10.2.3.jar;D:\repository\com\netflix\archaius\archaius-core\0.7.6\archaius-core-0.7.6.jar;D:\repository\com\google\code\findbugs\jsr305\3.0.1\jsr305-3.0.1.jar;D:\repository\com\google\guava\guava\16.0\guava-16.0.jar;D:\repository\com\netflix\hystrix\hystrix-core\1.5.18\hystrix-core-1.5.18.jar;D:\repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\repository\org\springframework\cloud\spring-cloud-starter-netflix-eureka-client\2.1.2.RELEASE\spring-cloud-starter-netflix-eureka-client-2.1.2.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-netflix-hystrix\2.1.2.RELEASE\spring-cloud-netflix-hystrix-2.1.2.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-netflix-eureka-client\2.1.2.RELEASE\spring-cloud-netflix-eureka-client-2.1.2.RELEASE.jar;D:\repository\com\netflix\eureka\eureka-client\1.9.12\eureka-client-1.9.12.jar;D:\repository\org\codehaus\jettison\jettison\1.3.7\jettison-1.3.7.jar;D:\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;D:\repository\com\netflix\netflix-commons\netflix-eventbus\0.3.0\netflix-eventbus-0.3.0.jar;D:\repository\com\netflix\netflix-commons\netflix-infix\0.3.0\netflix-infix-0.3.0.jar;D:\repository\commons-jxpath\commons-jxpath\1.3\commons-jxpath-1.3.jar;D:\repository\joda-time\joda-time\2.10.2\joda-time-2.10.2.jar;D:\repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;D:\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.jar;D:\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;D:\repository\com\google\code\gson\gson\2.8.5\gson-2.8.5.jar;D:\repository\org\apache\commons\commons-math\2.2\commons-math-2.2.jar;D:\repository\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;D:\repository\com\netflix\servo\servo-core\0.12.21\servo-core-0.12.21.jar;D:\repository\com\sun\jersey\jersey-core\1.19.1\jersey-core-1.19.1.jar;D:\repository\com\sun\jersey\jersey-client\1.19.1\jersey-client-1.19.1.jar;D:\repository\com\sun\jersey\contribs\jersey-apache-client4\1.19.1\jersey-apache-client4-1.19.1.jar;D:\repository\org\apache\httpcomponents\httpclient\4.5.9\httpclient-4.5.9.jar;D:\repository\org\apache\httpcomponents\httpcore\4.4.11\httpcore-4.4.11.jar;D:\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;D:\repository\com\google\inject\guice\4.1.0\guice-4.1.0.jar;D:\repository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\repository\com\github\vlsi\compactmap\compactmap\1.2.1\compactmap-1.2.1.jar;D:\repository\com\github\andrewoma\dexx\dexx-collections\0.2\dexx-collections-0.2.jar;D:\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;D:\repository\com\netflix\eureka\eureka-core\1.9.12\eureka-core-1.9.12.jar;D:\repository\com\fasterxml\woodstox\woodstox-core\5.0.3\woodstox-core-5.0.3.jar;D:\repository\org\codehaus\woodstox\stax2-api\3.1.4\stax2-api-3.1.4.jar;D:\repository\org\springframework\cloud\spring-cloud-starter-netflix-archaius\2.1.2.RELEASE\spring-cloud-starter-netflix-archaius-2.1.2.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-netflix-archaius\2.1.2.RELEASE\spring-cloud-netflix-archaius-2.1.2.RELEASE.jar;D:\repository\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;D:\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\repository\org\springframework\cloud\spring-cloud-starter-netflix-ribbon\2.1.2.RELEASE\spring-cloud-starter-netflix-ribbon-2.1.2.RELEASE.jar;D:\repository\com\netflix\ribbon\ribbon\2.3.0\ribbon-2.3.0.jar;D:\repository\com\netflix\ribbon\ribbon-transport\2.3.0\ribbon-transport-2.3.0.jar;D:\repository\io\reactivex\rxnetty-contexts\0.4.9\rxnetty-contexts-0.4.9.jar;D:\repository\io\reactivex\rxnetty-servo\0.4.9\rxnetty-servo-0.4.9.jar;D:\repository\io\reactivex\rxnetty\0.4.9\rxnetty-0.4.9.jar;D:\repository\com\netflix\ribbon\ribbon-core\2.3.0\ribbon-core-2.3.0.jar;D:\repository\com\netflix\ribbon\ribbon-httpclient\2.3.0\ribbon-httpclient-2.3.0.jar;D:\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\repository\com\netflix\netflix-commons\netflix-commons-util\0.3.0\netflix-commons-util-0.3.0.jar;D:\repository\com\netflix\ribbon\ribbon-loadbalancer\2.3.0\ribbon-loadbalancer-2.3.0.jar;D:\repository\com\netflix\netflix-commons\netflix-statistics\0.1.1\netflix-statistics-0.1.1.jar;D:\repository\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;D:\repository\com\netflix\ribbon\ribbon-eureka\2.3.0\ribbon-eureka-2.3.0.jar;D:\repository\com\thoughtworks\xstream\xstream\1.4.10\xstream-1.4.10.jar;D:\repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;D:\repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;D:\repository\org\springframework\cloud\spring-cloud-starter-config\2.1.3.RELEASE\spring-cloud-starter-config-2.1.3.RELEASE.jar;D:\repository\org\springframework\cloud\spring-cloud-config-client\2.1.3.RELEASE\spring-cloud-config-client-2.1.3.RELEASE.jar;D:\repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;D:\repository\org\springframework\boot\spring-boot-starter-web\2.1.6.RELEASE\spring-boot-starter-web-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;D:\repository\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;D:\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;D:\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\repository\org\springframework\boot\spring-boot-starter-json\2.1.6.RELEASE\spring-boot-starter-json-2.1.6.RELEASE.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;D:\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;D:\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;D:\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.6.RELEASE\spring-boot-starter-tomcat-2.1.6.RELEASE.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.21\tomcat-embed-core-9.0.21.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.21\tomcat-embed-el-9.0.21.jar;D:\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.21\tomcat-embed-websocket-9.0.21.jar;D:\repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;D:\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\repository\org\springframework\spring-webmvc\5.1.8.RELEASE\spring-webmvc-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;D:\repository\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;D:\repository\org\glassfish\jaxb\jaxb-core\2.3.0.1\jaxb-core-2.3.0.1.jar;D:\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;D:\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;D:\repository\org\glassfish\jaxb\txw2\2.3.1\txw2-2.3.1.jar;D:\repository\com\sun\istack\istack-commons-runtime\3.0.5\istack-commons-runtime-3.0.5.jar;D:\repository\com\sun\xml\bind\jaxb-impl\2.3.2\jaxb-impl-2.3.2.jar com.zsx.FeignApplication
  2. 2019-07-30 12:13:20.684 INFO 9188 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$d69195ff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  3. . ____ _ __ _ _
  4. /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
  5. ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
  6. \\/ ___)| |_)| | | | | || (_| | ) ) ) )
  7. ' |____| .__|_| |_|_| |_\__, | / / / /
  8. =========|_|==============|___/=/_/_/_/
  9. :: Spring Boot :: (v2.1.6.RELEASE)
  10. 2019-07-30 12:13:20.866 INFO 9188 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://localhost:8888
  11. 2019-07-30 12:13:21.934 INFO 9188 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available
  12. 2019-07-30 12:13:21.935 WARN 9188 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/spring-cloud-feign/default": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
  13. 2019-07-30 12:13:21.939 INFO 9188 --- [ main] com.zsx.FeignApplication : No active profile set, falling back to default profiles: default
  14. 2019-07-30 12:13:22.242 INFO 9188 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=a8608b78-e09e-3a19-a2af-c35025941e47
  15. 2019-07-30 12:13:22.252 INFO 9188 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.zsx.service.FeignTestService' of type [org.springframework.cloud.openfeign.FeignClientFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  16. 2019-07-30 12:13:22.281 INFO 9188 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$d69195ff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
  17. 2019-07-30 12:13:22.407 INFO 9188 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8085 (http)
  18. 2019-07-30 12:13:22.421 INFO 9188 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
  19. 2019-07-30 12:13:22.421 INFO 9188 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21]
  20. 2019-07-30 12:13:22.503 INFO 9188 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
  21. 2019-07-30 12:13:22.503 INFO 9188 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 538 ms
  22. 2019-07-30 12:13:22.632 WARN 9188 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
  23. 2019-07-30 12:13:22.632 INFO 9188 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
  24. 2019-07-30 12:13:22.633 WARN 9188 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
  25. 2019-07-30 12:13:22.633 INFO 9188 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
  26. 2019-07-30 12:13:22.697 INFO 9188 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
  27. 2019-07-30 12:13:22.944 INFO 9188 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
  28. 2019-07-30 12:13:22.959 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
  29. 2019-07-30 12:13:23.035 INFO 9188 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
  30. 2019-07-30 12:13:23.035 INFO 9188 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
  31. WARNING: An illegal reflective access operation has occurred
  32. WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/D:/repository/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar) to field java.util.TreeMap.comparator
  33. WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
  34. WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  35. WARNING: All illegal access operations will be denied in a future release
  36. 2019-07-30 12:13:23.093 INFO 9188 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
  37. 2019-07-30 12:13:23.093 INFO 9188 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
  38. 2019-07-30 12:13:23.175 INFO 9188 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
  39. 2019-07-30 12:13:23.207 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
  40. 2019-07-30 12:13:23.207 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
  41. 2019-07-30 12:13:23.207 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
  42. 2019-07-30 12:13:23.208 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
  43. 2019-07-30 12:13:23.208 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
  44. 2019-07-30 12:13:23.208 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
  45. 2019-07-30 12:13:23.208 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
  46. 2019-07-30 12:13:23.299 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 200
  47. 2019-07-30 12:13:23.300 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 30
  48. 2019-07-30 12:13:23.302 INFO 9188 --- [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
  49. 2019-07-30 12:13:23.303 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1564460003303 with initial instances count: 0
  50. 2019-07-30 12:13:23.305 INFO 9188 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application SPRING-CLOUD-FEIGN with eureka with status UP
  51. 2019-07-30 12:13:23.305 INFO 9188 --- [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1564460003305, current=UP, previous=STARTING]
  52. 2019-07-30 12:13:23.305 INFO 9188 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SPRING-CLOUD-FEIGN/172.20.202.43:spring-cloud-feign:8085: registering service...
  53. 2019-07-30 12:13:23.326 INFO 9188 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8085 (http) with context path ''
  54. 2019-07-30 12:13:23.326 INFO 9188 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8085
  55. 2019-07-30 12:13:23.328 INFO 9188 --- [ main] com.zsx.FeignApplication : Started FeignApplication in 3.125 seconds (JVM running for 3.562)
  56. 2019-07-30 12:13:23.336 INFO 9188 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SPRING-CLOUD-FEIGN/172.20.202.43:spring-cloud-feign:8085 - registration status: 204
  57. 2019-07-30 12:13:53.303 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Disable delta property : false
  58. 2019-07-30 12:13:53.303 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
  59. 2019-07-30 12:13:53.304 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
  60. 2019-07-30 12:13:53.304 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Application is null : false
  61. 2019-07-30 12:13:53.304 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
  62. 2019-07-30 12:13:53.304 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Application version is -1: false
  63. 2019-07-30 12:13:53.304 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
  64. 2019-07-30 12:13:53.353 INFO 9188 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient : The response status is 200

5. 查看注册中心

6. 查看Feign消费者http://localhost:8085/feign/hello

到此Feign熔断器配置完成 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/137662
推荐阅读
相关标签
  

闽ICP备14008679号