2016-01-09 56 views
2

我使用春季啓動1.3.1和春天cloudl Brixtom.M4,雖然使用springboot 1.3.1我發現渦輪AMQP項目不再可用,而是我們現在有了Spring Turbine Stream項目。 我該如何使用SpringTurbine與rabbitmq或kafka,並且想要監視在Zuul中註冊的所有路由的hystrix流,我能夠看到zuul的hystrix.stream,並且能夠在hystrix儀表板中看到該流,但不知道如何使用彈簧渦輪機流。 在網上我找到了使用Turbine AMQP的代碼和文檔。春天雲Zuul CircuitBreaker所有路線通過TurbineStream不渦輪 - AMQP

我有zuul服務器上運行的廣告http://localhost:9003/與depedencies

<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-config</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-eureka</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-zuul</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-actuator</artifactId> 
</dependency> 

和main.java作爲

@SpringBootApplication 
@EnableZuulProxy 
@EnableCircuitBreaker 
public class EdgeServerApplication { 

    public static void main(String[] args) { 
     SpringApplication.run(EdgeServerApplication.class, args); 
    } 
} 

我也有springTurbinestream項目作爲

<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-turbine-stream</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-stream-rabbit</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-web</artifactId> 
</dependency> 

org.springframework。開機 春季啓動 - 起動器

和主類TurbineStream作爲

@SpringBootApplication 
@EnableTurbineStream 
@EnableDiscoveryClient 
public class WiziqTurbineApplication { 

    public static void main(String[] args) { 
     SpringApplication.run(WiziqTurbineApplication.class, args); 
    } 
} 

當我運行的應用程序並進入http://localhost:9003/hystrix.stream我看到流,但如果我去http://localhost:9003/turbine.stream怎麼回事錯誤。

我在做什麼錯了?

+0

請提供downvoting的原因:( –

+0

我沒有downvote,但我沒有看到一個編程問題,我可能是錯誤的,但我也認爲它有點廣泛 –

+0

確定不錯,但仍然如果你知道回答請張貼 –

回答

2

您的客戶端應用程序(端口9003上)不應該有/turbine.stream。它應該發送帶有hystrix指標的消息給兔子(例如)。要做到這一點,你需要添加spring-cloud-netflix-hystrix-streamspring-cloud-starter-stream-rabbit(就像你在服務器上爲*-turbine-*依賴項所做的那樣)。

+0

出於好奇心spring-cloud-starter-bus-amqp和spring-cloud之間有什麼區別? -artarter-stream-rabbit –

+0

spring-cloud-starter-hystrix-stream不是可用的di d你的意思是如果我使用spring-cloud-starter-turbine-stream,則彈簧雲啓動器 - 渦輪流 –

+0

然後在向尤里卡進行註冊時,我看到兩個實例UP和啓動。我想這是因爲RxNetty服務器。並且該實例始終保持在起始狀態,渦輪流項目也是如此。 –