Created
November 19, 2019 05:59
-
-
Save AkshayMathur92/a837aa0aeb40693321d3faa9041aecd9 to your computer and use it in GitHub Desktop.
Demo Class for JerseyClient Memory Leak
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
public class WebClient { | |
private final Client client; | |
@Inject | |
public WebClient(Client client) { | |
this.client = client; | |
} | |
public Object call(String url){ | |
WebTarget target = client.target(url); | |
target.register(GZipEncoder.class); | |
Invocation.Builder invocationBuilder = target.request(MediaType.TEXT_PLAIN); | |
Response response = invocationBuilder.get(); | |
return response.getEntity(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment