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

Issue resolving AsynchResponse

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.7
    • 3.0.0-milestone1, 2.7.8
    • JAX-RS
    • None
    • Unknown

    Description

      Spring config

      <task:executor id="servicePool" pool-size="1" queue-capacity="${aw.concurrentUsers.download:5000}"/>

      JAX-RS server config

      <jaxrs:server id="restContainer" address="/" >
      <jaxrs:executor>
      <ref bean="servicePool"/>
      </jaxrs:executor>
      <jaxrs:serviceBeans>
      <ref bean="tokenService" />
      </jaxrs:serviceBeans>
      </jaxrs:server>

      Java End-Point

      @POST
      @Path("/createToken/

      {fileName}")
      @Produces(MediaType.APPLICATION_FORM_URLENCODED)
      //http://localhost:8000/contentGateway/integrationServices/tokenService/createToken/{fileName}

      public void createToken(@PathParam("fileName")final String fileName, final AsyncResponse asyncResponse)

      { validateInput(fileName); final String randomUUID = UUID.randomUUID().toString(); this.tokenRepository.storeToken(randomUUID.toString(),fileName); asyncResponse.resume(randomUUID); }

      JAXRSUtils.java : 766- 767

      if (parameterClass == AsyncResponse.class)

      { return new AsyncResponseImpl(message); }

      AsyncResponseImpl 53 - 59

      public AsyncResponseImpl(Message inMessage)

      { inMessage.put(AsyncResponse.class, this); inMessage.getExchange().put(ContinuationCallback.class, this); this.inMessage = inMessage; initContinuation(); }

      Line: 55

      inMessage.getExchange().put(ContinuationCallback.class, this);

      JAXRSInvoker.java : Line 86

      AsyncResponse asyncResp = exchange.get(AsyncResponse.class);

      Will always yield null, Since when setting the key will be for ContinuationCallback and when retrieving it will be for AsyncResponse

      Attachments

        1. sampleCXF.zip
          4 kB
          Sridhar Jonnalagadda

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            jonnals Sridhar Jonnalagadda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: