java - Setting a client receiveTimeout for CXF service above 4 minutes -
i have generated cxf service , set timeouts 120000ms = 2min
both:
requestcontext.put("javax.xml.ws.client.receivetimeout", 120000); requestcontext.put("javax.xml.ws.client.connectiontimeout", 120000);
it working fine, have tested 20s, 1min, 3min
- everytime waiting response exacly amout of time.
however problem apears when wanted set on 5min
. service waiting resposne ~240800ms = ~4min
.
i'm calling jboss esb service. 1 lasts max 5min
. cxf service called inside of simple .jar
application pc, there no other servers/containers between (like tomcat etc).
any ideas fix timeout settings?
using apache cxf 3.0.1
edit
what realized i'm getting 2 diffrent messages depends on timeout settings:
if set
<=4min
(via or @pedrofb method), after amount of time i'm getting:org.apache.cxf.interceptor.fault: not send message. @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderinterceptor.java:64) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:307) @ org.apache.cxf.endpoint.clientimpl.doinvoke(clientimpl.java:516)
caused by: java.net.sockettimeoutexception: sockettimeoutexception invoking http://esb:8080/myservice/ebws/category/myservice: read timed out
if set
>4min
or0
, i'm getting:javax.xml.ws.soap.soapfaultexception: no response received service [category:myservice], told not retry.
to honest, i'm pretty confused expected result (first one, think)
edit 2
i have tested myservice
via soapui
. have set 5min
timeout there , shoot sample request.
again, after little more 4 min i'm getting a:
<env:envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:header/> <env:body> <env:fault> <faultcode>env:server</faultcode> <faultstring>no response received service [category:myservice], told not retry.</faultstring> </env:fault> </env:body> </env:envelope>
however when log of jboss esb have no exceptions, no errors, myservice
last 1 min more (about 5 min) , return normal response - confirmed audit tool (which register every request esb - response , time).
i think point on @pedrofb mentioned in comment. suggestions can be?
maybe problem similar http://rayploski.blogspot.com.es/2010/08/jbossesb-setting-up-long-running.html client receives timeout while esb continue processing. in case needed configure org.jboss.soa.esb.ws.timeout
in esb
to configure client timeout, seems using requestcontext
parameters not standarized see https://java.net/jira/browse/jax_ws-1166. cxf team suggest can change
try using cxf specific parameters timeout
client client = clientproxy.getclient(proxy); httpconduit http = (httpconduit) client.getconduit(); httpclientpolicy httpclientpolicy = new httpclientpolicy(); httpclientpolicy.setconnectiontimeout(0); httpclientpolicy.setreceivetimeout(0); http.setclient(httpclientpolicy);
the complete list of parameters here. 0 means no timeout.
Comments
Post a Comment