2

我有一个关于骆驼路线关闭的​​问题。

以下是路线的代码片段 -

 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://" 端点相关的内容
。2. 我在日志中看到路由已成功正常关闭。示例:
"消息路由:路由 6 关闭完成,是消费来源:Endpoint[seda://eventIncr_insertInSolr?concurrentConsumers=100&pollTimeout=1]..."

问题 -
知道为什么 solr:// 的底层实现即使在路由终止(骆驼上下文关闭)后也不释放连接?

4

1 回答 1

0

它是camel-solr中的一个错误。停止 camel-solr 组件时资源未正确停止。我已经记录了一张票 https://issues.apache.org/jira/browse/CAMEL-6396

于 2013-05-25T05:26:56.867 回答