骆驼语境变化不会反映在hawtio中

时间:2017-06-18 01:18:00

标签: java apache-camel jbossfuse hawtio

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

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

有人可以建议任何配置,以便更改开始反映在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 source tab route

<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>

非常感谢高级。

1 个答案:

答案 0 :(得分:1)

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

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