com.netflix.zuul.exception.ZuulException:当我调用 POST 方法调用时转发错误

Kee*_*ana 1 java spring-cloud-netflix

**转发错误:**

当我通过 angularjs + Zuul + hystrix 调用我的 POST 微服务时,它显示转发异常。但是,如果我通过客户端 REST API 或 POSTMAN 进行调用,它会提供成功消息作为200 OK状态。

2017-04-24 19:09:50.315 WARN 6196 --- [nio-9090-exec-6] oscnzfilters.post.SendErrorFilter:过滤过程中出错

concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91] 在 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core -8.0.33.jar:8.0.33] 在 java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] 引起:com.netflix.hystrix.exception.HystrixRuntimeException: crudoperations timed-out并且没有可用的回退。在 com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:805) ~[hystrix-core-1.5.2.jar:1.5.2] 在 com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java: 789) ~[hystrix-core-1.5.2.jar:1.5.2] 在 rx.internal.operators.OperatorOnErrorResumeNextViaFunction$4.onError(OperatorOnErrorResumeNextViaFunction.java:139) ~[rxjava-1.1.5.jar:1.1.5]在 rx.internal.operators.OperatorDoOnEach$1。

And*_*own 5

我记得,默认的 hystrix 命令超时是 1000 毫秒,这对于 REST API 来说非常短,尤其是在您进行测试时。在您的应用程序 YML 中尝试此配置:

hystrix:
  command:
    default:
      execution:
        isolation:
          strategy: THREAD
          thread:
            timeoutInMilliseconds: 60000
Run Code Online (Sandbox Code Playgroud)