我有一个关于Camel路线关闭的问题 .
以下是该路线的代码段 -
from("seda:" + this.getDumpIdentifier() + "_insertInSolr?concurrentConsumers=50&pollTimeout=1")
// use streaming to increase index throughput
.setHeader(SolrConstants.OPERATION, constant(SolrConstants.OPERATION_INSERT_STREAMING))
.setExchangePattern(ExchangePattern.InOnly)
// define solr endpoint and options
.to("solr://" + this.getSolrEndPoint()
+ "?defaultMaxConnectionsPerHost=50&maxTotalConnections=150&maxRetries=3&allowCompression=true")
//
.log(LoggingLevel.DEBUG, "Successfully indexed document ID=${header.DOCUMENT_ID}.")
// end this route
.end();
我使用org.apache.camel.main.Main来启动Camel上下文(此路由) . 在成功处理我做 - camelMain.stop(); camelMain.shutdown();
但是在成功关闭路由后,我仍然看到处于CLOSE_WAIT状态的TCP连接(从此Indexer应用程序到部署在tomcat上的solr服务器) .
一些观察 - 1.在日志中我无法看到任何与solr://“ endpoints 相关的内容 .
2.我看到日志中路由成功正常关闭 . 例如:
"message Route: route6 shutdown complete, was consuming from: Endpoint[seda://eventIncr_insertInSolr?concurrentConsumers=100&pollTimeout=1]..."
题 -
任何想法为什么solr的底层实现://即使在路由终止(camel context off down)之后也没有释放连接?
1 回答
它是camel-solr中的一个bug . 停止camel-solr组件时,资源未正确停止 . 我已经记录了一张票https://issues.apache.org/jira/browse/CAMEL-6396