Reputation: 43
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?
Upvotes: 0
Views: 595
Reputation: 440
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.
Upvotes: 0
Reputation: 43
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
Upvotes: 0
Reputation: 61
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
Upvotes: 1