Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8955

Custom timeout with Message.RECEIVE_TIMEOUT not working with hc5 / hc

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.7, 3.6.2, 4.0.3
    • 3.5.8, 3.6.3, 4.0.4
    • JAX-WS Runtime
    • None
    • Fedora 36, Java 17, cxf 4.0.3

    • Unknown

    Description

      Hi, I am trying to set custom read timeouts for WS operations in an interceptor:

      public class CustomReadTimeoutInterceptor extends AbstractPhaseInterceptor<Message> {
      ...
      @Override
      public void handleMessage(Message message) {
        message.put(Message.RECEIVE_TIMEOUT, timeoutMillis);
      }
      ...

      That works well when using the JDK http client, but it does NOT work with the hc5 async client.
      It looks like requests issued in parallel affect each others timeout settings.

       

      Download the attached sample project, which contains a CustomReadTimeoutInterceptor and starts two requests in parallel with different timeouts (4 and 2 seconds).

      Execute both 

      mvn
      

      and

      mvn -DuseAsync
      

      and compare the output. The output of the first will be like

      CLIENT[19]: Duration: 2010 millis 
      CLIENT[29]: Duration: 4211 millis

      (which is as expected) whereas the second - using hc5 async - will result in

      CLIENT[29]: Duration: 4269 millis  
      CLIENT[19]: Duration: 4012 millis

      Now I am wondering if my code is somehow incorrect or if it is cxf's fault...

      Attachments

        1. cxf_timeout_bug.tar-2.gz
          3 kB
          Michael Wins

        Issue Links

          Activity

            People

              reta Andriy Redko
              michael.wins Michael Wins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: