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

Connect Timeout Error on cloudhub : Mule version:4.2.2

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

failed: Connect timeout.
errorType=HTTP:CONNECTIVITY
cause=org.mule.extension.http.api.error.HttpRequestFailedException

我设置的响应超时是5分钟。 部署在 cloudhub 上时流程运行良好 before.It 几天前停止工作,尽管我没有对我的 code.I 进行任何更改我无法调试此问题,因为它在我的本地环境中不可重现(它完美地工作)。任何帮助将不胜感激。

如果它正常工作,则可能是另一端发生了网络更改,阻止了 CloudHub 应用程序的访问。您没有共享 URL,因此不清楚它是内部主机还是 public 主机。我们也不知道服务器端是否有某种白名单。

您可以使用 Network Tools 应用程序测试与 HTTP 主机和端口的连接,以查看它是否可以从您的 CloudHub 环境访问。

mule HTTP 调用提供 4 种不同类型的一般超时。各有各的不同。

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

既然你得到了

HTTP:CONNECTIVITY ERROR. Applying a 5 min Response Timeout doesn't help. Response Timeout (means taking longer time to respond) should be worried only after Establishing a Connection Handshake.

您的问题出在连接本身。

您可以尝试解决此问题的唯一可能方法是 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.

This would tell if it's a real HTTP CONNECTIVITY problem or anything else related to some mule bug.

 2. Check your configurations once again and make sure if your hitting the same endpoint in the cloudhub version.

最后希望大家不要在本地版本中不小心放了任何proxy conf。