I am using a front end Spring Cloud application (micro service) acting as a Zuul proxy (@EnableZuulProxy
) to route requests from an external source to other internal micro services written using spring cloud (spring boot).
The Zuul server is straight out of the applications in the samples section
@SpringBootApplication @Controller @EnableZuulProxy @EnableDiscoveryClient public class ZuulServerApplication { public static void main(String[] args) { new SpringApplicationBuilder(ZuulServerApplication.class).web(true).run(args); } }
I ran this set of services locally and it all seems to work fine but if I run it on a network with some load, or through a VPN, then I start to see Zuul forwarding errors, which I am seeing as client timeouts in the logs.
Is there any way to change the timeout on the Zuul forwards so that I can eliminate this issue from my immediate concerns? What accessible parameter settings are there for this?
If you want to configure the socket timeouts and read timeouts for requests proxied through Zuul, you have two options, based on your configuration: If Zuul uses service discovery, you need to configure these timeouts with the ribbon. ReadTimeout and ribbon. SocketTimeout Ribbon properties.
Zuul 1 and Archaius 1 have both been superseded by later versions that are not backward compatible. The following Spring Cloud Netflix modules and corresponding starters will be placed into maintenance mode: spring-cloud-netflix-archaius. spring-cloud-netflix-hystrix-contract.
Zuul is built to enable dynamic routing, monitoring, resiliency, and security. It can also route the requests to multiple Amazon Auto Scaling Groups. For Example, /api/products are mapped to the product service and /api/user is mapped to the user service.
Zuul creates a Hystrix circuit breaker for each route (serviceId). It means that one Hystrix circuit breaker will be shared between your all instances of payment-services. The circuit breaker that Zuul creates for each route is not for removing an unhealthy instance from the routing list.
In my case I had to change the following property:
zuul.host.socket-timeout-millis=30000
The properties to set are: ribbon.ReadTimeout
in general and <service>.ribbon.ReadTimeout
for a specific service, in milliseconds. The Ribbon wiki has some examples. This javadoc has the property names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With