私はJersey v10を使用しており、次のコードを書きました。これは、Jerseyクライアント接続を閉じてメモリリークを回避する正しい方法ですか.私は最終的にこれまで呼び出しを行っていませんでした.
ClientConfig config = setupHttps();
final Client c = Client.create(config);
final WebResource r = c.resource(baseUri);
ClientResponse response = null;
try {
response = r.path("/....")
.header("contentId", id)
.header("sid", sid).get(ClientResponse.class);
...
} catch (Exception e) {
log.error("Error returning contentServiceName.");
} finally {
if (response != null) {
response.close();
}
if (c!= null) {
c.destroy();
}
}
TIA、ビジェイ