Reputation: 1289
This is my basic mule flow
:
HTTP Listener
> Logger
> Http Request
> Logger
(Result message)
<http:request-config name="HTTP_Request_Configuration" host="localhost" port="8080" doc:name="HTTP Request Configuration" usePersistentConnections="false"/>
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="servoy-restFlow">
<http:listener config-ref="HTTP_Listener_Configuration"
path="/" doc:name="HTTP" />
<logger message="#[message.payloadAs(java.lang.String)]" level="INFO"
doc:name="Logger" />
<http:request config-ref="HTTP_Request_Configuration"
path="service/rest/request" method="POST"
doc:name="HTTP" />
<logger message="#[message.payloadAs(java.lang.String)]" level="INFO"
doc:name="Logger" />
</flow>
But it returns an error about timeout exception:
********************************************************************************
Exception stack is:
1. Timeout exceeded (java.util.concurrent.TimeoutException)
com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider:426 (null)
2. Error sending HTTP request. Message payload is of type: String (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:426)
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$3.onTimeout(GrizzlyAsyncHttpProvider.java:274)
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)
********************************************************************************
What should I do to avoid the timeout?
Upvotes: 1
Views: 23834
Reputation: 180
Where you receive the POST request - maybe a method or microflow, there is actions that happen first and after that the POST is executed. If you cannot change the logic there and remove them, just increase the timeout in the request configuration in Mule.
Upvotes: 0
Reputation: 31
You can set Timeout for your entire application configuring a global deafult timeout property at the beginning of your .xml, in example:
<configuration defaultTransactionTimeout="90000" defaultResponseTimeout="90000" doc:name="Configuration">
<default-threading-profile poolExhaustedAction="RUN"/>
</configuration>
I hope this helps.
Upvotes: 1
Reputation: 4551
The default
timeout of http outbound request
is 30 seconds specified in ms
in mule. Increase timeout of http-request config to greater than 30 seconds, may be to start with 40 seconds and see what's your desired number.
<http:request-config responseTimeout="40000" .../>
Upvotes: 6
Reputation: 106
Taking another approach to this problem...
Do you have an issue with the service you are trying to consume and it's not responding. I've always found the default timeout to be sufficient (even for calling external services).
Upvotes: 2
Reputation: 33413
Try increasing the timeout in:
<http:request-config responseTimeout="XYZ" />
Upvotes: 2