Spring Cloud Zuul Monitor/CircuitBreaker通过Hystrix的所有路线 [英] Spring Cloud Zuul Monitor/CircuitBreaker All Routes via Hystrix

查看:183
本文介绍了Spring Cloud Zuul Monitor/CircuitBreaker通过Hystrix的所有路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring Cloud和@EnableZuulProxy是否可以通过/hystrix.stream使用hystrix监视application.yml中配置的所有路由?在下面的示例中,我希望有一种简单的方法来监视对下游产品服务的所有请求.我了解我可以在产品服务本身上执行此操作,但是可以监视Zuul请求.对于任何非第三方拥有的,不能用@HystrixCommand注释的下游服务,这将很有用.

I am using Spring Cloud and @EnableZuulProxy Is it possible to monitor all routes configured in application.yml using hystrix via /hystrix.stream? In the example below I would like to have a simple way to monitor all request made to the down stream product service. I understand that I can do this on the product service itself, but is it possible to monitor Zuul request. This would be useful for any down stream services that are not owned (third party) and cannot be annotated with the @HystrixCommand.

zuul: routes: item: serviceId: product path: /product/**

zuul: routes: item: serviceId: product path: /product/**

推荐答案

简单的答案是肯定的.添加spring-cloud-starter-hystrix并将@EnableCircuitBreaker添加到您的主类.这将启用/hystrix.stream.当转发到其他服务时,Zuul使用hystrix.

The simple answer is yes. Add spring-cloud-starter-hystrix and add @EnableCircuitBreaker to your main class. That will enable /hystrix.stream. Zuul uses hystrix when forwarding to other services.

这篇关于Spring Cloud Zuul Monitor/CircuitBreaker通过Hystrix的所有路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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