{"id":49279,"date":"2025-07-30T17:02:03","date_gmt":"2025-07-30T09:02:03","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/49279.html"},"modified":"2025-07-30T17:02:03","modified_gmt":"2025-07-30T09:02:03","slug":"java%e3%80%90%e4%bb%a3%e7%a0%81-17%e3%80%91httpclient-poolinghttpclientconnectionmanager-%e8%bf%9e%e6%8e%a5%e6%b1%a0%e4%bd%bf%e7%94%a8%e4%b8%be%e4%be%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/49279.html","title":{"rendered":"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b"},"content":{"rendered":"<\/p>\n<h4>httpclient \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b<\/h4>\n<ul>\n<li>1. \u95ee\u9898<\/li>\n<li>\n<ul>\n<li>1.1 TIME_WAIT \u72b6\u6001\u8fde\u63a5\u7684\u539f\u56e0\u548c\u89e3\u51b3\u7b56\u7565<\/li>\n<li>1.2 CLOSE_WAIT \u72b6\u6001\u8fde\u63a5\u7684\u539f\u56e0\u548c\u89e3\u51b3\u7b56\u7565<\/li>\n<li>1.3 \u8bca\u65ad\u5de5\u5177<\/li>\n<\/ul>\n<\/li>\n<li>2. \u4f9d\u8d56<\/li>\n<li>3. \u4ee3\u7801<\/li>\n<li>\n<ul>\n<li>3.1 \u7ebf\u7a0b\u6c60\u914d\u7f6e<\/li>\n<li>3.2 \u65b9\u6cd5\u8c03\u7528<\/li>\n<\/ul>\n<\/li>\n<li>4. \u8bf4\u660e<\/li>\n<\/ul>\n<h2>1. \u95ee\u9898<\/h2>\n<p>\u670d\u52a1\u5668\u4e0a\u6709\u5927\u91cf\u7684time_wait\u6216\u8005close_wait\u72b6\u6001\u7684\u8fde\u63a5&#xff0c;\u6545\u67e5\u8be2\u4e86 GPT\u3002<\/p>\n<h3>1.1 TIME_WAIT \u72b6\u6001\u8fde\u63a5\u7684\u539f\u56e0\u548c\u89e3\u51b3\u7b56\u7565<\/h3>\n<li>\u5927\u91cf\u77ed\u8fde\u63a5\n<ul>\n<li>\u5927\u91cf\u77ed\u6682\u7684\u8fde\u63a5\u4f1a\u5bfc\u81f4\u77ed\u65f6\u95f4\u5185\u751f\u6210\u5927\u91cf\u7684TIME_WAIT\u72b6\u6001\u8fde\u63a5\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u5c3d\u91cf\u4f7f\u7528\u957f\u8fde\u63a5&#xff0c;\u51cf\u5c11\u8fde\u63a5\u7684\u521b\u5efa\u548c\u9500\u6bc1\u6b21\u6570\u3002<\/li>\n<\/ul>\n<\/li>\n<li>TCP \u65f6\u95f4\u7b49\u5f85\u6c60\u6ea2\u51fa\n<ul>\n<li>\u5982\u679c\u670d\u52a1\u5668\u77ed\u65f6\u95f4\u5185\u6709\u5927\u91cf\u7684\u8fde\u63a5\u8fdb\u5165TIME_WAIT\u72b6\u6001&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4TCP\u65f6\u95f4\u7b49\u5f85\u6c60\u6ea2\u51fa\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u5185\u6838\u53c2\u6570\u6765\u589e\u52a0\u65f6\u95f4\u7b49\u5f85\u6c60\u7684\u5927\u5c0f&#xff0c;\u6216\u8005\u51cf\u5c11TIME_WAIT\u72b6\u6001\u7684\u6301\u7eed\u65f6\u95f4\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u8fde\u63a5\u590d\u7528\n<ul>\n<li>\u5982\u679c\u670d\u52a1\u5668\u7684\u8fde\u63a5\u590d\u7528\u7387\u4f4e&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4\u66f4\u591a\u7684TIME_WAIT\u72b6\u6001\u8fde\u63a5\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u4f7f\u7528\u8fde\u63a5\u6c60\u6280\u672f&#xff0c;\u63d0\u9ad8\u8fde\u63a5\u7684\u590d\u7528\u7387\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5185\u6838\u53c2\u6570\u8c03\u6574\n<ul>\n<li>\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u5185\u6838\u53c2\u6570\u6765\u7f29\u77edTIME_WAIT\u72b6\u6001\u7684\u6301\u7eed\u65f6\u95f4&#xff0c;\u4f8b\u5982\u8c03\u6574net.ipv4.tcp_fin_timeout\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u5728Linux\u7cfb\u7edf\u4e2d&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u8c03\u6574\u5185\u6838\u53c2\u6570\u6765\u51cf\u5c11TIME_WAIT\u72b6\u6001\u7684\u6301\u7eed\u65f6\u95f4&#xff0c;\u4f8b\u5982&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<p><span class=\"token comment\"># \u51cf\u5c11TIME_WAIT\u72b6\u6001\u7684\u6301\u7eed\u65f6\u95f4<\/span><br \/>\nsysctl -w net.ipv4.tcp_fin_timeout<span class=\"token operator\">&#061;<\/span><span class=\"token number\">30<\/span><\/p>\n<li>SYN Cookies\n<ul>\n<li>\u5982\u679c\u670d\u52a1\u5668\u9762\u4e34SYN Flood\u653b\u51fb&#xff0c;\u53ef\u4ee5\u542f\u7528SYN Cookies\u673a\u5236\u6765\u7f13\u89e3\u8fd9\u79cd\u653b\u51fb\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u5728Linux\u7cfb\u7edf\u4e2d&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6enet.ipv4.tcp_syncookies\u4e3a1\u6765\u542f\u7528SYN Cookies\u3002<\/li>\n<\/ul>\n<\/li>\n<h3>1.2 CLOSE_WAIT \u72b6\u6001\u8fde\u63a5\u7684\u539f\u56e0\u548c\u89e3\u51b3\u7b56\u7565<\/h3>\n<li>\u5e94\u7528\u7a0b\u5e8f\u672a\u6b63\u786e\u5173\u95ed\u8fde\u63a5\n<ul>\n<li>\u5982\u679c\u5ba2\u6237\u7aef\u6216\u670d\u52a1\u5668\u7684\u5e94\u7528\u7a0b\u5e8f\u6ca1\u6709\u6b63\u786e\u5173\u95ed\u8fde\u63a5&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8fde\u63a5\u505c\u7559\u5728CLOSE_WAIT\u72b6\u6001\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u68c0\u67e5\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801&#xff0c;\u786e\u4fdd\u6240\u6709\u8fde\u63a5\u5728\u4f7f\u7528\u5b8c\u6bd5\u540e\u90fd\u6b63\u786e\u5173\u95ed\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u8d44\u6e90\u6cc4\u9732\n<ul>\n<li>\u5982\u679c\u5e94\u7528\u7a0b\u5e8f\u672a\u80fd\u91ca\u653e\u8d44\u6e90\u6216\u8c03\u7528\u5fc5\u8981\u7684\u5173\u95ed\u65b9\u6cd5&#xff0c;\u4e5f\u53ef\u80fd\u5bfc\u81f4CLOSE_WAIT\u72b6\u6001\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u4f7f\u7528\u8d44\u6e90\u7ba1\u7406\u6846\u67b6\u6216\u5de5\u5177\u6765\u81ea\u52a8\u7ba1\u7406\u8d44\u6e90\u7684\u751f\u547d\u5468\u671f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u7b2c\u4e09\u65b9\u5e93\u95ee\u9898&#xff1a;\n<ul>\n<li>\u5982\u679c\u60a8\u4f7f\u7528\u4e86\u7b2c\u4e09\u65b9\u5e93\u6216\u6846\u67b6&#xff0c;\u53ef\u80fd\u5b58\u5728\u67d0\u4e9b\u5e93\u672a\u80fd\u6b63\u786e\u5904\u7406\u8fde\u63a5\u5173\u95ed\u7684\u60c5\u51b5\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u66f4\u65b0\u7b2c\u4e09\u65b9\u5e93\u5230\u6700\u65b0\u7248\u672c&#xff0c;\u6216\u8005\u5bfb\u627e\u66ff\u4ee3\u65b9\u6848\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u7f51\u7edc\u5ef6\u8fdf&#xff1a;\n<ul>\n<li>\u5982\u679c\u7f51\u7edc\u5ef6\u8fdf\u8f83\u9ad8&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5173\u95ed\u63e1\u624b\u8fc7\u7a0b\u53d8\u6162&#xff0c;\u4ece\u800c\u4ea7\u751fCLOSE_WAIT\u72b6\u6001\u7684\u8fde\u63a5\u3002<\/li>\n<li>\u89e3\u51b3\u65b9\u6848&#xff1a;\u4f18\u5316\u7f51\u7edc\u914d\u7f6e&#xff0c;\u51cf\u5c11\u7f51\u7edc\u5ef6\u8fdf\u3002<\/li>\n<\/ul>\n<\/li>\n<h3>1.3 \u8bca\u65ad\u5de5\u5177<\/h3>\n<ul>\n<li>netstat\u547d\u4ee4&#xff1a;\u4f7f\u7528netstat -an | grep TIME_WAIT\u6216netstat -an | grep CLOSE_WAIT\u6765\u67e5\u770b\u5f53\u524d\u5904\u4e8eTIME_WAIT\u6216CLOSE_WAIT\u72b6\u6001\u7684\u8fde\u63a5\u3002<\/li>\n<li>ss\u547d\u4ee4&#xff1a;\u4f7f\u7528ss -t -a | grep TIME_WAIT\u6216ss -t -a | grep CLOSE_WAIT\u6765\u83b7\u53d6\u66f4\u8be6\u7ec6\u7684\u8fde\u63a5\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p>\u4e0d\u5f97\u4e0d\u8bf4&#xff0c;\u5927\u6a21\u578b\u7684\u56de\u7b54\u8fd8\u4f1a\u5f88\u5168\u9762\u7684\u3002<\/p>\n<h2>2. \u4f9d\u8d56<\/h2>\n<p>SpringBoot \u9879\u76ee\u4f9d\u8d56&#xff1a;<\/p>\n<p> <span class=\"token comment\">&lt;!&#8211; https:\/\/mvnrepository.com\/artifact\/org.apache.httpcomponents\/httpclient &#8211;&gt;<\/span><br \/>\n <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n     <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>org.apache.httpcomponents<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n     <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>httpclient<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n     <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>4.5.13<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<p>\u975e SpringBoot \u9879\u76ee\u9700\u8981\u5f15\u5165&#xff1a;<\/p>\n<ul>\n<li>httpclient-4.5.13.jar<\/li>\n<li>httpcore-4.4.13.jar<\/li>\n<\/ul>\n<h2>3. \u4ee3\u7801<\/h2>\n<h3>3.1 \u7ebf\u7a0b\u6c60\u914d\u7f6e<\/h3>\n<p><span class=\"token keyword\">import<\/span> <span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>apache<span class=\"token punctuation\">.<\/span>http<span class=\"token punctuation\">.<\/span>impl<span class=\"token punctuation\">.<\/span>client<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">CloseableHttpClient<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>apache<span class=\"token punctuation\">.<\/span>http<span class=\"token punctuation\">.<\/span>impl<span class=\"token punctuation\">.<\/span>client<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">HttpClientBuilder<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>apache<span class=\"token punctuation\">.<\/span>http<span class=\"token punctuation\">.<\/span>impl<span class=\"token punctuation\">.<\/span>client<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">HttpClients<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">import<\/span> <span class=\"token namespace\">org<span class=\"token punctuation\">.<\/span>apache<span class=\"token punctuation\">.<\/span>http<span class=\"token punctuation\">.<\/span>impl<span class=\"token punctuation\">.<\/span>conn<span class=\"token punctuation\">.<\/span><\/span><span class=\"token class-name\">PoolingHttpClientConnectionManager<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/**<br \/>\n * HttpClientManager\u7ba1\u7406<br \/>\n *\/<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">HttpClientManager<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token keyword\">private<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token class-name\">HttpClientBuilder<\/span> httpClientBuilder <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">private<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token class-name\">CloseableHttpClient<\/span> closeableHttpClient <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">private<\/span> <span class=\"token class-name\">HttpClientManager<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u521b\u5efa\u8fde\u63a5\u7ba1\u7406\u5668<\/span><br \/>\n        <span class=\"token class-name\">PoolingHttpClientConnectionManager<\/span> connMgr <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">PoolingHttpClientConnectionManager<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u6574\u4e2a\u8fde\u63a5\u6c60\u7684\u6700\u5927\u8fde\u63a5\u6570<\/span><br \/>\n        connMgr<span class=\"token punctuation\">.<\/span><span class=\"token function\">setMaxTotal<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u6bcf\u4e2a\u8def\u7531\u7684\u6700\u5927\u8fde\u63a5\u6570<\/span><br \/>\n        connMgr<span class=\"token punctuation\">.<\/span><span class=\"token function\">setDefaultMaxPerRoute<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u521b\u5efaHttpClientBuilder\u5e76\u8bbe\u7f6e\u8fde\u63a5\u7ba1\u7406\u5668<\/span><br \/>\n        httpClientBuilder <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">HttpClients<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">custom<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">setConnectionManager<\/span><span class=\"token punctuation\">(<\/span>connMgr<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p>    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">synchronized<\/span> <span class=\"token class-name\">CloseableHttpClient<\/span> <span class=\"token function\">getCloseableHttpClient<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>closeableHttpClient <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">HttpClientManager<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            closeableHttpClient <span class=\"token operator\">&#061;<\/span> httpClientBuilder<span class=\"token punctuation\">.<\/span><span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> closeableHttpClient<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token punctuation\">}<\/span><\/p>\n<li>setMaxTotal(int max)&#xff1a;\u8bbe\u7f6e\u6574\u4e2a\u8fde\u63a5\u6c60\u7684\u6700\u5927\u8fde\u63a5\u6570\u3002<\/li>\n<li>setDefaultMaxPerRoute(int max)&#xff1a;\u8bbe\u7f6e\u6bcf\u4e2a\u8def\u7531&#xff08;\u4f8b\u5982\u5230\u540c\u4e00\u4e3b\u673a\u7684\u6240\u6709\u8fde\u63a5&#xff09;\u7684\u6700\u5927\u8fde\u63a5\u6570\u3010\u9ed8\u8ba4\u503c\u662f 2\u3011\u3002<\/li>\n<p>\u5728HTTP\u5ba2\u6237\u7aef\u4e2d&#xff0c;\u201c\u8def\u7531\u201d\u662f\u6307\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u4e00\u6761\u903b\u8f91\u8def\u5f84\u3002\u901a\u5e38\u60c5\u51b5\u4e0b&#xff0c;\u5f53\u5ba2\u6237\u7aef\u53d1\u9001\u8bf7\u6c42\u5230\u4e0d\u540c\u7684\u7aef\u70b9&#xff08;\u5373\u4f7f\u662f\u540c\u4e00\u4e2a\u670d\u52a1\u5668\u7684\u4e0d\u540cURL&#xff09;&#xff0c;\u53ea\u8981\u76ee\u6807\u670d\u52a1\u5668\u76f8\u540c&#xff0c;\u8fd9\u4e9b\u8bf7\u6c42\u90fd\u4f1a\u7ecf\u8fc7\u76f8\u540c\u7684\u7f51\u7edc\u8def\u5f84&#xff0c;\u56e0\u6b64\u4f1a\u88ab\u89c6\u4e3a\u540c\u4e00\u4e2a\u8def\u7531\u3002<\/p>\n<li>setMaxPerRoute(HttpRoute route, int max)&#xff1a;\u53ef\u4ee5\u9488\u5bf9\u7279\u5b9a\u8def\u7531\u8bbe\u7f6e\u6700\u5927\u8fde\u63a5\u6570\u3002<\/li>\n<h3>3.2 \u65b9\u6cd5\u8c03\u7528<\/h3>\n<p>    <span class=\"token keyword\">public<\/span> <span class=\"token class-name\">JSONObject<\/span> <span class=\"token function\">postHttpReq<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> json<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">String<\/span> url<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u83b7\u53d6http\u5ba2\u6237\u7aef<\/span><br \/>\n        <span class=\"token class-name\">CloseableHttpClient<\/span> httpClient <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">HttpClientManager<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">getCloseableHttpClient<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u8bbe\u7f6e\u8d85\u65f6\u65f6\u95f4<\/span><br \/>\n        <span class=\"token class-name\">RequestConfig<\/span> requestConfig <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">RequestConfig<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">custom<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">setConnectTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">5000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">setSocketTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">20000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">setConnectionRequestTimeout<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">5000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u5c01\u88c5\u8bf7\u6c42\u53c2\u6570<\/span><br \/>\n        <span class=\"token keyword\">byte<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> b <span class=\"token operator\">&#061;<\/span> json<span class=\"token punctuation\">.<\/span><span class=\"token function\">getBytes<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">HttpEntity<\/span> httpEntity <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">ByteArrayEntity<\/span><span class=\"token punctuation\">(<\/span>b<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">String<\/span> responseMsg <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">int<\/span> statusCode <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token class-name\">CloseableHttpResponse<\/span> response <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u521b\u5efahttpPost\u8bf7\u6c42<\/span><br \/>\n            <span class=\"token class-name\">HttpPost<\/span> httpPost <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">HttpPost<\/span><span class=\"token punctuation\">(<\/span>url<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            httpPost<span class=\"token punctuation\">.<\/span><span class=\"token function\">setConfig<\/span><span class=\"token punctuation\">(<\/span>requestConfig<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            httpPost<span class=\"token punctuation\">.<\/span><span class=\"token function\">setEntity<\/span><span class=\"token punctuation\">(<\/span>httpEntity<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            httpPost<span class=\"token punctuation\">.<\/span><span class=\"token function\">setHeader<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Content-Type&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;application\/json;charset&#061;GBK&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u6267\u884c\u8bf7\u6c42<\/span><br \/>\n            response <span class=\"token operator\">&#061;<\/span> httpClient<span class=\"token punctuation\">.<\/span><span class=\"token function\">execute<\/span><span class=\"token punctuation\">(<\/span>httpPost<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u83b7\u53d6\u8bf7\u6c42\u7ed3\u679c<\/span><br \/>\n            statusCode <span class=\"token operator\">&#061;<\/span> response<span class=\"token punctuation\">.<\/span><span class=\"token function\">getStatusLine<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">getStatusCode<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            responseMsg <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">EntityUtils<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">toString<\/span><span class=\"token punctuation\">(<\/span>response<span class=\"token punctuation\">.<\/span><span class=\"token function\">getEntity<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">IOException<\/span> e1<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            e1<span class=\"token punctuation\">.<\/span><span class=\"token function\">printStackTrace<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">finally<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token comment\">\/\/ \u5173\u95ed\u5f53\u524d\u8bf7\u6c42<\/span><br \/>\n                response<span class=\"token punctuation\">.<\/span><span class=\"token function\">close<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">IOException<\/span> e2<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                e2<span class=\"token punctuation\">.<\/span><span class=\"token function\">printStackTrace<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u89e3\u6790\u8bf7\u6c42\u7ed3\u679c<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>statusCode <span class=\"token operator\">!&#061;<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u8f93\u51fa\u9519\u8bef\u4fe1\u606f<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">return<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">JSONObject<\/span><span class=\"token punctuation\">(<\/span>responseMsg<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><\/p>\n<h2>4. \u8bf4\u660e<\/h2>\n<ul>\n<li>\u4ee3\u7801\u5e76\u4e0d\u5b8c\u5584&#xff0c;\u6ca1\u6709\u5173\u95edhttpclient\u7684\u65b9\u6cd5\u548c\u5173\u95ed\u8fde\u63a5\u6c60\u7684\u65b9\u6cd5\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb612\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86HTTP\u8fde\u63a5\u6c60\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u9488\u5bf9\u670d\u52a1\u5668\u51fa\u73b0\u5927\u91cfTIME_WAIT\u548cCLOSE_WAIT\u72b6\u6001\u8fde\u63a5\u7684\u95ee\u9898\u63d0\u4f9b\u4e86\u89e3\u51b3\u65b9\u6848\u3002\u6587\u7ae0\u5206\u6790\u4e86\u8fd9\u4e24\u79cd\u72b6\u6001\u7684\u539f\u56e0\u53ca\u89e3\u51b3\u7b56\u7565\uff0c\u5305\u62ec\u4f7f\u7528\u8fde\u63a5\u6c60\u3001\u8c03\u6574\u5185\u6838\u53c2\u6570\u7b49\u3002\u63d0\u4f9b\u4e86\u57fa\u4e8eApache HttpClient 4.5.13\u7684\u8fde\u63a5\u6c60\u914d\u7f6e\u4ee3\u7801\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u521b\u5efa\u548c\u7ba1\u7406\u8fde\u63a5\u6c60\uff0c\u4ee5\u53ca\u5982\u4f55\u901a\u8fc7\u8fde\u63a5\u6c60\u53d1\u8d77HTTP\u8bf7\u6c42\u3002\u6587\u4e2d\u8fd8\u6307\u51fa\u4e86\u5f53\u524d\u4ee3\u7801\u5b58\u5728\u7684\u4e0d\u8db3\uff0c\u5982\u7f3a\u5c11\u5173\u95edhttpclient\u548c\u8fde\u63a5\u6c60\u7684\u65b9\u6cd5\u3002\u6574\u4f53\u89e3\u51b3\u65b9\u6848\u65e8\u5728\u63d0\u9ad8\u8fde\u63a5\u590d\u7528\u7387\uff0c\u51cf\u5c11\u77ed\u8fde\u63a5\u521b\u5efa\uff0c\u4f18\u5316\u670d\u52a1\u5668\u6027\u80fd\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4788,89,92,99],"topic":[],"class_list":["post-49279","post","type-post","status-publish","format-standard","hentry","category-server","tag-javacode","tag-git","tag-github","tag-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/49279.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb612\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86HTTP\u8fde\u63a5\u6c60\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u9488\u5bf9\u670d\u52a1\u5668\u51fa\u73b0\u5927\u91cfTIME_WAIT\u548cCLOSE_WAIT\u72b6\u6001\u8fde\u63a5\u7684\u95ee\u9898\u63d0\u4f9b\u4e86\u89e3\u51b3\u65b9\u6848\u3002\u6587\u7ae0\u5206\u6790\u4e86\u8fd9\u4e24\u79cd\u72b6\u6001\u7684\u539f\u56e0\u53ca\u89e3\u51b3\u7b56\u7565\uff0c\u5305\u62ec\u4f7f\u7528\u8fde\u63a5\u6c60\u3001\u8c03\u6574\u5185\u6838\u53c2\u6570\u7b49\u3002\u63d0\u4f9b\u4e86\u57fa\u4e8eApache HttpClient 4.5.13\u7684\u8fde\u63a5\u6c60\u914d\u7f6e\u4ee3\u7801\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u521b\u5efa\u548c\u7ba1\u7406\u8fde\u63a5\u6c60\uff0c\u4ee5\u53ca\u5982\u4f55\u901a\u8fc7\u8fde\u63a5\u6c60\u53d1\u8d77HTTP\u8bf7\u6c42\u3002\u6587\u4e2d\u8fd8\u6307\u51fa\u4e86\u5f53\u524d\u4ee3\u7801\u5b58\u5728\u7684\u4e0d\u8db3\uff0c\u5982\u7f3a\u5c11\u5173\u95edhttpclient\u548c\u8fde\u63a5\u6c60\u7684\u65b9\u6cd5\u3002\u6574\u4f53\u89e3\u51b3\u65b9\u6848\u65e8\u5728\u63d0\u9ad8\u8fde\u63a5\u590d\u7528\u7387\uff0c\u51cf\u5c11\u77ed\u8fde\u63a5\u521b\u5efa\uff0c\u4f18\u5316\u670d\u52a1\u5668\u6027\u80fd\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/49279.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T09:02:03+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/49279.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/49279.html\",\"name\":\"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T09:02:03+00:00\",\"dateModified\":\"2025-07-30T09:02:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/49279.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/49279.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/49279.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/49279.html","og_locale":"zh_CN","og_type":"article","og_title":"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb612\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf10\u6b21\u3002\u672c\u6587\u4ecb\u7ecd\u4e86HTTP\u8fde\u63a5\u6c60\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u9488\u5bf9\u670d\u52a1\u5668\u51fa\u73b0\u5927\u91cfTIME_WAIT\u548cCLOSE_WAIT\u72b6\u6001\u8fde\u63a5\u7684\u95ee\u9898\u63d0\u4f9b\u4e86\u89e3\u51b3\u65b9\u6848\u3002\u6587\u7ae0\u5206\u6790\u4e86\u8fd9\u4e24\u79cd\u72b6\u6001\u7684\u539f\u56e0\u53ca\u89e3\u51b3\u7b56\u7565\uff0c\u5305\u62ec\u4f7f\u7528\u8fde\u63a5\u6c60\u3001\u8c03\u6574\u5185\u6838\u53c2\u6570\u7b49\u3002\u63d0\u4f9b\u4e86\u57fa\u4e8eApache HttpClient 4.5.13\u7684\u8fde\u63a5\u6c60\u914d\u7f6e\u4ee3\u7801\u793a\u4f8b\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u521b\u5efa\u548c\u7ba1\u7406\u8fde\u63a5\u6c60\uff0c\u4ee5\u53ca\u5982\u4f55\u901a\u8fc7\u8fde\u63a5\u6c60\u53d1\u8d77HTTP\u8bf7\u6c42\u3002\u6587\u4e2d\u8fd8\u6307\u51fa\u4e86\u5f53\u524d\u4ee3\u7801\u5b58\u5728\u7684\u4e0d\u8db3\uff0c\u5982\u7f3a\u5c11\u5173\u95edhttpclient\u548c\u8fde\u63a5\u6c60\u7684\u65b9\u6cd5\u3002\u6574\u4f53\u89e3\u51b3\u65b9\u6848\u65e8\u5728\u63d0\u9ad8\u8fde\u63a5\u590d\u7528\u7387\uff0c\u51cf\u5c11\u77ed\u8fde\u63a5\u521b\u5efa\uff0c\u4f18\u5316\u670d\u52a1\u5668\u6027\u80fd\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/49279.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T09:02:03+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/49279.html","url":"https:\/\/www.wsisp.com\/helps\/49279.html","name":"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T09:02:03+00:00","dateModified":"2025-07-30T09:02:03+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/49279.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/49279.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/49279.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Java\u3010\u4ee3\u7801 17\u3011httpclient PoolingHttpClientConnectionManager \u8fde\u63a5\u6c60\u4f7f\u7528\u4e3e\u4f8b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/49279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=49279"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/49279\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=49279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=49279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=49279"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=49279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}