New Mule version 3.7.0 gives timeout exception when i try to read feed via simple HTTP

偶尔善良 提交于 2020-01-15 20:56:12

问题


Just updated to mule esb version to 3.7.0 and end up breaking the system. I just created simple HTTP connector to load feed from web site and its throwing timeout exception even after setting the max timeout as 2 minutes.

Sample Code :

<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>

In the above code ,if i just keep the base path as baspath="/" ,then i am able to load the whole site.If i make the base path to point to feed as basePath="/feed/" then it throws the time out exception.This is applicable for all the site which has rss feeds.It doesn't work even after adding user agent as mule in set property or in direct URL.

Below is the exception :

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


Message : Error sending HTTP request. Message payload is of type: NullPayload Type : org.mule.api.MessagingException Code : MULE_ERROR--2 JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html Payload : {NullPayload}


Exception stack is: 1. Timeout exceeded (java.util.concurrent.TimeoutException) com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider:463 (null) 2. Error sending HTTP request. Message payload is of type: 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)


Root Exception stack trace: java.util.concurrent.TimeoutException: Timeout exceeded at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.timeout(GrizzlyAsyncHttpProvider.java:463) at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$3.onTimeout(GrizzlyAsyncHttpProvider.java:308) at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:398) at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:377) at org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run(DelayedExecutor.java:158) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)


回答1:


I did a quick test with your code, but removed the proxy from the request-config and everything worked fine.

Code:

<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>

Then I called http://localhost:8081/sfdc and got the feed from theaggie.org. Does that work for you without the Proxy?



来源:https://stackoverflow.com/questions/32557677/new-mule-version-3-7-0-gives-timeout-exception-when-i-try-to-read-feed-via-simpl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!