我的eureka中注册了user服务 和 gateway-zuul-fallback 服务
直接访问user服务localhost:8081/user/getUser?id=1 没问题
通过zuul访问userlocalhost:8097/user/user/getUser?id=1 也没问题
zuul服务yml配置:
fallbackConfig
我把 user服务挂掉,通过zuul代理访问报以下错误:(怎么返回的不是fallback error string)
2018-05-22 10:46:33.835 WARN 9020 --- [nio-8097-exec-9] o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering
com.netflix.zuul.exception.ZuulException: null
at org.springframework.cloud.netflix.zuul.util.ZuulRuntimeException.(ZuulRuntimeException.java:33) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]
at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:119) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]
Caused by: java.lang.NullPointerException: null
at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:159) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]
at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:111) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE]
... 66 common frames omitted
页面返回:
{
"timestamp": 1526956683342,
"status": 500,
"error": "Internal Server Error",
"exception": "com.netflix.zuul.exception.ZuulException",
"message": "No message available"
}