cloudhub 上的连接超时错误:Mule 版本:4.2.2

HMT*_*HMT 5 esb cloudhub anypoint-studio mulesoft

我正在尝试使用 https 客户端 api,它在邮递员(在 800 毫秒内给出响应)和本地骡子流上工作正常,但在 cloudhub 上工作正常。我收到连接超时错误。它尝试连接 30 秒(根据日志),然后给出 HTTP:CONNECTIVITY 错误。

failed: Connect timeout.
errorType=HTTP:CONNECTIVITY
cause=org.mule.extension.http.api.error.HttpRequestFailedException
Run Code Online (Sandbox Code Playgroud)

我设置的响应超时是 5 分钟。之前在 cloudhub 上部署时,流程工作正常。几天前它停止工作,尽管我没有对我的代码进行任何更改。我无法调试这个问题,因为它在我的本地环境中无法重现(它工作得很好)。任何帮助,将不胜感激。

Thi*_*101 1

mule HTTP 调用提供 4 种不同类型的常规超时。每个都有自己的差异。

  • 连接空闲超时
  • 响应超时
  • 最大空闲超时
  • 查询或事务超时(适用于数据库连接器)

既然你得到了

HTTP:连接错误。应用 5 分钟响应超时没有帮助。仅在建立连接握手后才应担心响应超时(意味着需要更长的时间来响应)。

您的问题在于连接本身。

您可以尝试解决此问题的唯一可能方法是通过Applying a Connection Idle Timeout一些Reconnection Strategy频率间隙。

既然你对本地测试如此确定。我建议您执行以下两个步骤:

1. Try using the same HTTP connector configuration in a separate new mule APP. Try with a simple listener and the failing requestor. Also add one more freely available online REST services into your code in other extra flow. Now try to test both. See which one is working and which is failing.
Run Code Online (Sandbox Code Playgroud)

这可以判断是否是真正的 HTTP 连接问题或与某些 mule bug 相关的其他问题。

 2. Check your configurations once again and make sure if your hitting the same endpoint in the cloudhub version.
Run Code Online (Sandbox Code Playgroud)

最后,希望您没有意外地将任何代理配置放入本地版本中。