【问题标题】:Camel Context changes not reflect in hawtio骆驼上下文更改未反映在 hawtio
【发布时间】:2017-06-18 01:18:00
【问题描述】:

我在我的 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 源标签路由

<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 捆绑包,但无法正常工作
  • Karaf 6.3 Apache Camel 2.17.0 hawtio 1.4.0

标签: java apache-camel jbossfuse hawtio


【解决方案1】:

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

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

【讨论】:

  • 非常感谢@Claus Ibsen,很荣幸与您交谈。我是 Apache Camel 和 Fuse 的新手,我试图通过将项目添加到服务器来在 Jboss Studio 中部署两个 Fuse 项目。您能否指出我如何通过 Jboss Studio 在 Karaf 中添加 2-3 个项目。 2.)我还尝试了源代码重建和重新部署到 Karaf 的各种时间更改,即使我删除了数据文件夹,但源代码更改仍然没有反映在 hawtio 中。我是否需要更改任何配置文件以反映 hawtio.请提出您的宝贵意见
  • @Arun 一定要在 POM 中用-SNAPSHOT 版本标记你的包。如果您重新部署相同的稳定版本,它可能不会重新加载所有内容。
猜你喜欢
  • 2014-10-27
  • 2015-01-23
  • 2017-11-08
  • 1970-01-01
  • 2018-12-26
  • 2023-02-10
  • 2015-06-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多