0

I am calling the external web service from the Java Component by using the CXF Client Proxy, as described in: https://docs.mulesoft.com/mule-user-guide/v/3.7/consuming-web-services-with-cxf#building-a-client-proxy

The default execution time is set to 10 seconds, but the web service sometimes may require more time to complete. I tried increasing the time with:

    ClientBuilder.newClient().property("http.receive.timeout", 600000);

, but it didn't help. Using the example from the above link, how to increase the timeout?

3 Answers3

1
sun.net.client.defaultConnectTimeout (default: -1 (forever))
sun.net.client.defaultReadTimeout (default: -1 (forever))

this will apply to all calls done.

or you can try to set the timeout in context.

Map<String, Object> requestContext = (BindingProvider)myInterface).getRequestContext();
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT, 3000); // Timeout in millis
requestContext.put(BindingProviderProperties.CONNECT_TIMEOUT, 1000); // Timeout in millis
0

I tried both solutions from the above post, and neither of them works. The correct answer is to use configuration:

<configuration defaultResponseTimeout="300000"></configuration>

as described in : https://docs.mulesoft.com/mule-user-guide/v/3.6/global-settings-configuration-reference

0

you could use the responseTimeout parameter to pass the timeout along with the endpoint URL. This will give you more flexibility in the sense that you won't be tied with using the defaultTimeout setting. Please see the answer linked here.

http response timeout

Community
  • 1
  • 1
jvas
  • 440
  • 1
  • 7
  • 19