在Zuul和Eureka First中使用Hystrix Stream查找配置服务器 [英] Using Hystrix Stream in Zuul with Eureka First to find Config server

查看:220
本文介绍了在Zuul和Eureka First中使用Hystrix Stream查找配置服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有弹簧靴1.3.1的弹簧云Brixton.M4

I'm using spring cloud Brixton.M4 with spring boot 1.3.1

我的zuul服务器带有

I have zuul server with

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-netflix-hystrix-stream</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
    </dependency>

我首先使用Eureka来找到Config-Server,所以引导看起来像

and i'm using Eureka first to find Config-Server so bootstrap looks like

spring:
 profiles: dev 
 cloud:
   config:
     fail-fast: true
     discovery:
       enabled: true
       serviceId: config-server

zuul两次处于注册状态,首先处于 UP 状态,然后处于 STARTING

zuul is registring two time first with UP state then with STARTING

2016-01-18 14:47:27.209  INFO 2808 --- [           main] c.w.i.edgeserver.EdgeServerApplication   : Started EdgeServerApplication in 21.651 seconds (JVM running for 22.232)
2016-01-18 14:47:56.231  INFO 2808 --- [ool-20-thread-1] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EDGE-SERVER/192.168.17.178:edge-server:8003 - Re-registering apps/EDGE-SERVER
2016-01-18 14:47:56.270  INFO 2808 --- [ool-20-thread-1] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EDGE-SERVER/192.168.17.178:edge-server:8003: registering service...
2016-01-18 14:47:56.281  INFO 2808 --- [ool-20-thread-1] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EDGE-SERVER/192.168.17.178:edge-server:8003 - registration status: 204
2016-01-18 14:48:06.230  INFO 2808 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EDGE-SERVER/192.168.17.178:edge-server:8003: registering service...
2016-01-18 14:48:06.238  INFO 2808 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_EDGE-SERVER/192.168.17.178:edge-server:8003 - registration status: 204

如果我通过设置删除对配置服务器的依赖

If I remove dependency on config-server by setting

spring:
 profiles: dev 
 cloud:
   config:
     fail-fast: false
     discovery:
       enabled: false
       serviceId: config-server

一切正常.

推荐答案

我认为这很正常(引导阶段必须注册以获取configserver位置,然后取消注册以使主应用程序再次注册).您可能会发现,在应用程序完全启动后,它会恢复到UP.

That's normal I think (the bootstrap phase has to register to get the configserver location, and then unregister to let the main application register again). You will probably find that it settles back to UP after the application has started up fully.

这篇关于在Zuul和Eureka First中使用Hystrix Stream查找配置服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆