0

我有这个 :

15:20:06 | INFO  | aultShutdownStrategy | mel.impl.DefaultShutdownStrategy   73 | Starting to graceful shutdown routes (timeout 300 seconds)
15:20:06 | INFO  | aultShutdownStrategy | mel.impl.DefaultShutdownStrategy  106 | Graceful shutdown of routes completed in 0 seconds
15:20:06 | WARN  | ltInflightRepository | l.impl.DefaultInflightRepository   91 | Shutting down while there are still 1 in flight exchanges.

我以为优雅的关闭会等待这个在飞行中的交换降落!为什么说“关闭路线在 0 秒内完成”?

这可能与Thread.sleep(30000);我在交换仍在进行中的路线中的处理器中编写的有关吗?

编辑 :

我有这个配置到 applicationContext :

<bean id="MainRouteBuilder" class="something.router2.MainRoute" init-method="init">
    <property name="ruleService" >
        <osgi:reference interface="something.router2.service.RuleService" />
    </property>
    <property name="controlInbox" value="${router.controlInbox}" />
    <property name="errorBox" value="${router.errorBox}" />
    <property name="rulesCamelContext" ref="secondCamelContext" />
</bean>


<!-- Camel -->
<camelContext xmlns="http://camel.apache.org/schema/spring" id="myCamelContext">
    <routeBuilder ref="MainRouteBuilder"/>
</camelContext>

<camelContext xmlns="http://camel.apache.org/schema/spring" id="secondCamelContext">
</camelContext>

我尝试使用“myCamelContext”将“secondCamelContext”停止到一条路线中。

4

1 回答 1

1

你如何关闭应用程序?

如果您从路由触发关闭,请参阅此常见问题解答:http ://camel.apache.org/how-can-i-stop-a-route-from-a-route.html如何正确执行此操作。如果这样做错误,那么您可能会遇到上述情况,当您关机时,1 条飞行消息卡在注册表中。

于 2013-07-28T06:25:01.870 回答