Zuul Proxy not able to route, resulting in com.netflix.zuul.exception.ZuulException: Forwarding error

user5921551 picture user5921551 · Feb 13, 2016 · Viewed 59.4k times · Source

I have simple services as:

transactions-core-service and transactions-api-service.

transactions-api-service invokes transactions-core-service to return a list of transactions. transactions-api-service is enabled with hystrix command.

Both are registered in Eureka server with below services ids:

TRANSACTIONS-API-SERVICE    n/a (1) (1) UP (1) - 192.168.2.12:transactions-api-service:8083
TRANSACTIONS-CORE-SERVICE   n/a (1) (1) UP (1) - 192.168.2.12:transactions-core-service:8087

Below is Zuul server:

@SpringBootApplication

@Controller

@EnableZuulProxy

public class ZuulApplication {

    public static void main(String[] args) {
        new SpringApplicationBuilder(ZuulApplication.class).web(true).run(args);
    }
}

Zuul Configurations:

===============================================

info:
  component: Zuul Server

server:
  port: 8765

endpoints:
  restart:
    enabled: true
  shutdown:
    enabled: true
  health:
    sensitive: false

zuul:
  ignoredServices: "*"
  routes:
    transactions-api-service: 
    path: transactions/accounts/**
    serviceId: transactions-api-service

eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

logging:
  level:
    ROOT: INFO
    org.springframework.web: DEBUG

===============================================

When I try to invoke transactions-api-service with url (http://localhost:8765/transactions/accounts/123/transactions/786) I get Zuul Exception:

2016-02-13 11:29:29.050 WARN 4936 --- [nio-8765-exec-1] o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering

com.netflix.zuul.exception.ZuulException: Forwarding error at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:131) ~[spring-cloud-net flix-core-1.1.0.M3.jar:1.1.0.M3] at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:76) ~[spring-cloud-netflix- core-1.1.0.M3.jar:1.1.0.M3] ......

If I invoke the transactions-api-service individually (with localhost /accounts/123/transactions/786), it works fine.

Am I missing any configurations on Zuul?

Answer

Rafik  picture Rafik · Apr 6, 2016

You need to change zuul execution timeout by adding this property in application.yml of zuul server:

# Increase the Hystrix timeout to 60s (globally)
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000

Please refer to this thread on netflix issues: https://github.com/spring-cloud/spring-cloud-netflix/issues/321