Hi,

Is that code thread and memory leak safe (by intensive multithread using):

<jaxrs-client:client id="myWebClient"
                  address="http://localhost/myservice";
                  serviceClass="org.apache.cxf.jaxrs.client.WebClient"
                  inheritHeaders="true"
                  threadSafe="true">

        <jaxrs-client:providers>
            <bean 
class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
        </jaxrs-client:providers>

        <jaxrs-client:properties>
            <entry key="http.receive.timeout" value="60"/>
        </jaxrs-client:properties>
</jaxrs-client:client>

....
   // injection on class level
   WebClient myWebClient;

    // concurrent using
    Response myResponse = myWebClient.accept(MediaType.APPLICATION_JSON)
                        .header("Content-Type", MediaType.APPLICATION_JSON)
                        .query(QUERY_TOKEN, apiToken)
                        .path(PATH_SERVICE_AREAS + zipCode)
                        .get();
      myWebClient.reset()

Regards,
Andrei.

Reply via email to