I am very new to Jersey and I did a search, but could not figure out if there is a way for the jersey client to use the connection pool instead of creating a connection every time we send a new request.
The whole idea is to reuse a set of connections from a pool that will save lots or a resource. FYI I'm not looking for Connection: keep-alive .
This is what I do now
public void postData() { Client client = new Client(); WebResource webResource = client.resource("http://SomeService.com/.."); ClientResponse response = webResource.accept("text/plain").get(ClientResponse.class); System.out.println(response.getStatus()); System.out.println(response.getEntity(String.class)); }
Any help is very noticeable, expecting a piece of code. Thanks in advance.
source share