ilovkatie ilovkatie - 1 year ago 89
Java Question

Setting a client receiveTimeout for CXF service above 4 minutes

I have generated an CXF service and set timeouts for

120000ms = 2min
for both:

requestContext.put("", 120000);
requestContext.put("", 120000);

It is working fine, I have tested it for
20s, 1min, 3min
- everytime it is waiting for response exacly that amout of time.

However problem apears when I wanted to set it on
. Service is waiting for resposne only for
~240800ms = ~4min

I'm calling jboss esb service. This one lasts max
. CXF service is called from inside of simple
application from my PC, so there is no other servers/containers between (like tomcat etc).

Any ideas to fix my timeout settings?

Using a
Apache CXF 3.0.1


What I realized now that I'm getting 2 diffrent messages depends on my timeout settings:

  • If I set it to
    (via my or @pedrofb method), after that amount of time I'm getting:

    org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(

    Caused by: SocketTimeoutException invoking http://esb:8080/MyService/ebws/Category/MyService: Read timed out

  • if I set it to
    , I'm getting: No response received for service [Category:MyService], Told not to retry.

To be honest, I'm pretty confused what is an expected result (first one, I think)


I have tested
. I have set a
timeout there and shoot with sample request.

Again, after little more then 4 min I'm getting a:

<env:Envelope xmlns:env="">
<faultstring>No response received for service [Category:MyService], Told not to retry.</faultstring>

However when I look into log of Jboss ESB I have no exceptions, no errors,
last a 1 min more (about 5 min) and return normal response - which is confirmed by audit tool (which register every request to my esb - with response and time).

I think that this point on that what @pedrofb mentioned in comment. Any suggestions what this can be?

Answer Source

Maybe your problem is similar to this The client receives a timeout while the ESB continue processing. In this case it is needed to configure in ESB

To configure client timeout, seems using requestContext parameters are not standarized see CXF team suggest they can change

Try using CXF specific parameters for timeout

Client client = ClientProxy.getClient(proxy);
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();

The complete list of parameters is here. 0 means no timeout.