微服务Spring Cloud zuul报错:com.netflix.zuul.exception.ZuulException:

这就是错误信息,很奇怪;困扰我有半个小时才解决;
我这里用的是application.properties的配置文件;

  • o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering (译文:误差在过滤)
com.netflix.zuul.exception.ZuulException: 
	at org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter.findZuulException(SendErrorFilter.java:114)
    at org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter.run(SendErrorFilter.java:76)
    at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:117)
    at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:193)
    at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:157)
    at com.netflix.zuul.FilterProcessor.error(FilterProcessor.java:105)
    at com.netflix.zuul.ZuulRunner.error(ZuulRunner.java:112)
    at com.netflix.zuul.http.ZuulServlet.error(ZuulServlet.java:145)
    at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:83)
    at 
  • 之前的配置信息:首先排除了代码有错,因为这是我在之前的微服务上添加的网关
    错误就在zuul网关超时,每次请求必定要报这个错误。
# 网关名字
spring.application.name=eureka-client-zuul
server.port=9091
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka

# 城市列表提供者
zuul.routes.city.path=/zuulCity/**
zuul.routes.city.serviceId=cityDataProvider-eureka

# 自身api提供者
zuul.routes.myapi.path=/myapi/**
zuul.routes.myapi.serviceId=projectProvider-eureka
  • 在配置文件里面添加zuul网关超时配置就可以了;
    在这里感谢这位大佬的博客给我的启发 https://blog.csdn.net/tianyaleixiaowu/article/details/78772269
# 在这里路由方式是 url方式的,Zuul的超时配置
zuul.host.connect-timeout-millis=2000
zuul.host.socket-timeout-millis=10000

在这里插入图片描述

你可能感兴趣的:(Spring,Cloud)