【问题标题】:New Mule version 3.7.0 gives timeout exception when i try to read feed via simple HTTP当我尝试通过简单的 HTTP 读取提要时,新的 Mule 版本 3.7.0 会出现超时异常
【发布时间】:2015-12-10 00:49:21
【问题描述】:

刚刚更新到 mule esb 版本到 3.7.0 并最终破坏了系统。 我刚刚创建了简单的 HTTP 连接器来从网站加载提要,即使将最大超时设置为 2 分钟,它也会引发超时异常。

示例代码:

<http:request-config name="HTTP_Request_Configuration" host="www.theaggie.org" port="80" basePath="/feed/" doc:name="HTTP Request Configuration">
    <http:proxy host="xxxxx" port="8080" username="xxxx" password="xxxx"/>
</http:request-config>
<flow name="testFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/sfdc" doc:name="HTTP"/>
    <logger message="hjkhh" level="INFO" doc:name="Logger"/>
    <set-property propertyName="User-Agent" value="MuleESB" doc:name="Property" mimeType="application/xml"/>
    <response>
        <http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
    </response>

</flow>

在上面的代码中,如果我只是保持基本路径为 baspath="/",那么我可以加载整个站点。如果我将基本路径指向作为 basePath="/feed/"然后它会抛出超时异常。这适用于所有具有 rss 提要的站点。即使在 set 属性或直接 URL 中添加用户代理作为 mule 后,它也不起作用。

以下是例外:

INFO 2015-09-14 15:01:05,288 [[test].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor:hjkhh 错误 2015-09-14 15:01:16,432 [[test].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy:


消息:发送 HTTP 请求时出错。消息负载的类型:NullPayload 类型:org.mule.api.MessagingException 代码:MULE_ERROR--2 JavaDoc:http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html 有效载荷:{NullPayload}


异常堆栈是: 1.超时(java.util.concurrent.TimeoutException) com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider:463(空) 2.发送HTTP请求时出错。消息负载的类型:NullPayload (org.mule.api.MessagingException) org.mule.module.http.internal.request.DefaultHttpRequester:287 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)


根异常堆栈跟踪: java.util.concurrent.TimeoutException:超时 在 com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.timeout(GrizzlyAsyncHttpProvider.java:463) 在 com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$3.onTimeout(GrizzlyAsyncHttpProvider.java:308) 在 org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:398) 在 org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:377) 在 org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run(DelayedExecutor.java:158) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在 java.lang.Thread.run(Thread.java:745)

【问题讨论】:

  • 我在通过不是最佳的公共 wifi 连接时遇到了类似的问题。首先在全局请求属性设置中更改持久连接设置下的连接超时有效。但它的成功是断断续续的。因此,只需通过我的蜂窝数据计划连接即可解决问题。

标签: http mule esb connector


【解决方案1】:

我对您的代码进行了快速测试,但从请求配置中删除了代理,一切正常。

代码:

<http:request-config name="HTTP_Request_Configuration" host="www.theaggie.org" port="80" basePath="/feed/" doc:name="HTTP Request Configuration">
</http:request-config>
    <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="testFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/sfdc" doc:name="HTTP"/>
    <logger message="hjkhh" level="INFO" doc:name="Logger"/>
    <set-property propertyName="User-Agent" value="MuleESB" doc:name="Property" mimeType="application/xml"/>
        <response>
            <http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
        </response>

</flow>

然后我打电话给http://localhost:8081/sfdc 并从 theaggie.org 获得了提要。如果没有代理,这对您有用吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-04
    相关资源
    最近更新 更多