我有一个关于骆驼路线关闭的问题。
下面是路由- 的代码片段 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();
但是在成功关闭路由后,我仍然看到TCP连接处于CLOSE_WAIT状态(从这个Indexer应用程序到部署在tomcat上的solr服务器)。
一些观察-1. 在日志中,我无法看到任何与solr://" endpoint.
相关的内容。2. 我在日志中看到路由成功地正常关闭。例子:
"message Route: route6 shutdown complete, was consuming from: Endpoint[seda://eventIncr_insertInSolr?concurrentConsumers=100&pollTimeout=1]…"
问题——
你知道为什么solr://的底层实现即使在路由终止(骆驼上下文关闭)后也不释放连接吗?
这是camel-solr的一个bug。停止camel-solr组件时,资源没有正常停止。我已经登记了一张票https://issues.apache.org/jira/browse/camel - 6396