gpt4 book ai didi

java - Camel 上下文更改未反射(reflect)在 hawtio 中

转载 作者:行者123 更新时间:2023-12-02 12:50:59 24 4
gpt4 key购买 nike

我的 JVM 中运行着 Camel,并且 hawtio 连接到了它。我可以在 hawtio JMX 选项卡中看到 Camel 详细信息。当我更改camelcontex.xml 中的任何内容并重新启动我的karaf 时,更改并未反射(reflect)在hawtio 中。

所以我无法调试我的路线hawtio。

有人可以建议任何配置,以便更改开始反射(reflect)在 hawtio 中,我可以通过 hawtio 调试我的路线。

我的 CamelContex.xml

<route id="cbr-route">
<from id="_from1" uri="file://C:/temp/camel"/>
<log id="_log1" message="Receiving order ${file:name}"/>
<choice id="_choice1">
<when id="_when1">
<xpath id="_xpath1">/order/customer/country = 'UK'</xpath>
<log id="_log2" message="Sending order ${file:name} to the UK"/>
<to id="_to1" uri="file:work/cbr/output/uk"/>
</when>
<when id="_when2">
<xpath id="_xpath2">/order/customer/country = 'US'</xpath>
<log id="_log3" message="Sending order ${file:name} to the US"/>
<to id="_to2" uri="file:work/cbr/output/us"/>
</when>
<otherwise id="_otherwise1">
<log id="_log4" message="Sending order ${file:name} to another country"/>
<to id="_to3" uri="file:work/cbr/output/others"/>
</otherwise>
</choice>
<log id="_log5" message="Done processing ${file:name}"/>
</route>

hawtio 源选项卡路由

<route xmlns="http://camel.apache.org/schema/spring" id="cbr-route">
<from uri="file:work/cbr/input" id="_from1"/>
<log message="Receiving order ${file:name}" id="_log1"/>
<choice id="_choice1">
<when id="_when1">
<xpath>/order/customer/country = 'UK'</xpath>
<log message="Sending order ${file:name} to the UK" id="_log2"/>
<to uri="file:work/cbr/output/uk" id="_to1"/>
</when>
<when id="_when2">
<xpath>/order/customer/country = 'US'</xpath>
<log message="Sending order ${file:name} to the US" id="_log3"/>
<to uri="file:work/cbr/output/us" id="_to2"/>
</when>
<otherwise id="_otherwise1">
<log message="Sending order ${file:name} to another country" id="_log4"/>
<to uri="file:work/cbr/output/others" id="_to3"/>
</otherwise>
</choice>
<log message="Done processing ${file:name}" id="_log5"/>
</route>

非常感谢您的高级。

最佳答案

如果您的意思是从 hawtio Web 控制台更改 Camel XML,那么这些更改不是持久性的,它们仅在运行时在内存中更改。如果您需要持久更改,则需要更改源代码、重建并重新部署到 karaf。

但是,Karaf 也支持通过将单个 xml 文件复制到部署文件夹来部署该文件。然后您可以对该文件进行更改并保存,karaf 应该检测文件更改并自动重新部署。

关于java - Camel 上下文更改未反射(reflect)在 hawtio 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44610895/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com