通過httpclient訪問第三方接口,并發(fā)量上來總是出現(xiàn)管道斷開異常,這個該如何處理比較好?請求部分代碼:CloseableHttpClient client = HttpClients.createDefault();String content = null;CloseableHttpResponse resp = null;try {resp = client.execute(httpPost);if (resp.getStatusLine().getStatusCode() == 200) {HttpEntity he = resp.getEntity();content = EntityUtils.toString(he, encode);}異常:o.s.boot.context.web.ErrorPageFilter :Cannot forward to error page for request [/api/xx/xxx] as the response has already been committed.Caused by: java.io.IOException: 斷開的管道at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[na:1.8.0_91]at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) ~[na:1.8.0_91]at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[na:1.8.0_91]at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[na:1.8.0_91]at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) ~[na:1.8.0_91]at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:124) ~[tomcat-coyote.jar:8.0.28]
http post請求管道斷開
慕田峪7331174
2019-03-22 19:15:18