我在ApacheTomcat中部署了基于ApacheCamel的集成引擎,它使用公共http客户机对外部Web服务进行http调用。大多数情况下得到成功的调用,但很少或服务器重启后的第一个调用,我得到连接重置错误。
这与应该适用于所有时间的套接字超时或连接超时无关。我已经启用了下面给出的http级别日志记录和跟踪。
(组件版本camel-http-2.18.2.jar、commons-httpclient-3.1.jar、apache-tomcat-8.5.11)
apache.camel.component.http.HttpProducer - Executing http POST method:
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager - HttpConnectionManager.getConnection:
config = HostConfiguration[host=https://nodeD1.test.webservices.test.com], timeout = 0
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager - Getting free connection,
hostConfig=HostConfiguration[host=https://nodeD1.test.webservices.test.com]
httpclient.wire.header - >> "POST /1ASIWPLRHUR HTTP/1.1[\r][\n]"
httpclient.wire.header - >> "http-url:[https://nodeD1.test.webservices.test.com]"
httpclient.wire.header - >> "httpClient.soTimeout: 30000[\r][\n]"
httpclient.wire.header - >> "SOAPAction: [edited]"
httpclient.wire.header - >> "transport-type: http[\r][\n]"
httpclient.wire.header - >> "x-sequence-id: 1.101.102.101[\r][\n]"
httpclient.wire.header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
httpclient.wire.header - >> "Host: nodeD1.test.webservices.test.com[\r][\n]"
httpclient.wire.header - >> "Content-Length: 4505[\r][\n]"
httpclient.wire.header - >> "Content-Type: text/xml,charset=UTF-8[\r][\n]"
httpclient.wire.header - >> "[\r][\n]"
httpclient.wire.content - >> "<?xml version="1.0" encoding="UTF-8"?>[\n]"
httpclient.wire.content - >> "[edited]"
apache.commons.httpclient.methods.EntityEnclosingMethod - Request body sent
org.apache.commons.httpclient.HttpMethodDirector - Closing the connection.
org.apache.commons.httpclient.HttpMethodDirector - Method retry handler returned false. Automatic recovery will not be attempted
org.apache.commons.httpclient.HttpConnection - Releasing connection back to connection manager.
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager - Freeing connection,
hostConfig=HostConfiguration[host=https://nodeD1.test.webservices.test.com]
apache.commons.httpclient.util.IdleConnectionHandler - Adding connection at: 1547029324609
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager - Notifying no-one, there are no waiting threads
org.apache.camel.processor.DefaultErrorHandler - Failed delivery on delivery attempt: 0 caught: java.net.SocketException: Connection reset
ERROR org.apache.camel.processor.DefaultErrorHandler - Failed delivery for
Exhausted after delivery attempt: 1 caught: java.net.SocketException: Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:940)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
at org.apache.camel.component.http.HttpProducer.executeMethod(HttpProducer.java:257)
at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:152)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:124)
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:436)
at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:119)
有人能帮我找出到底是什么导致了这个连接重置问题吗?
暂无答案!
目前还没有任何答案,快来回答吧!