Search code examples
spring-cloudnetflix-zuulhystrix

Zuul Hystrix stream without using serviceId


I have a few Zuul routes defined and everything works great. The hystrix stream is empty and according to this the reason is that I am not using a service.

So I would like some help on how I could work around this. I do not have Eureka (and do not wish to start using for this simple app). Is there some way to get the hystrix stream with url instead of serviceId?

Any help will be much appreciated.

Here are example routes I have configured. The URL placeholders come from my profile specific configs.

zuul.routes.v1stores.path=/v1/stores
zuul.routes.v1stores.url=${target.url}

zuul.routes.v1order.path=/v1/order/**
zuul.routes.v1order.url=${target.url}/v1/order

Solution

  • Currently using the url attribute, sets up zuul to NOT use Hystrix. You need to use ribbon to access the Hystrix functionality in Zuul. To do so, you could do something like this (see docs):

    zuul.routes.v1order.path=/v1/order/**
    zuul.routes.v1order.serviceId=v1order
    
    v1order.ribbon.NIWSServerListClassName=com.netflix.loadbalancer.ConfigurationBasedServerList
    v1order.ribbon.listOfServers=${target.url}