Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache camel 在卡拉夫使用骆驼河_Apache Camel_Apache Karaf - Fatal编程技术网

Apache camel 在卡拉夫使用骆驼河

Apache camel 在卡拉夫使用骆驼河,apache-camel,apache-karaf,Apache Camel,Apache Karaf,我在卡拉夫经营一条普通航线。我知道它在工作,因为当我将stream:out更改为log:test时,我可以每隔5秒看到日志中的消息。然而,我似乎在karaf控制台中没有得到任何东西。我还安装了camel stream,在日志中没有看到任何错误。当我运行karaf bin/客户端时,我是否应该看到流:out数据?谢谢 <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns

我在卡拉夫经营一条普通航线。我知道它在工作,因为当我将stream:out更改为log:test时,我可以每隔5秒看到日志中的消息。然而,我似乎在karaf控制台中没有得到任何东西。我还安装了camel stream,在日志中没有看到任何错误。当我运行karaf bin/客户端时,我是否应该看到流:out数据?谢谢

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<camelContext xmlns="http://camel.apache.org/schema/blueprint" id="simple">
<route>
    <from uri="timer:simple?period=5000"/>
        <setBody>
            <simple>Hello World</simple>
        </setBody>
    <to uri="stream:out"/>
 </route>
</camelContext>
</blueprint>
我也尝试过以下方法:

service KARAF-service stop
cd /usr/local/karaf
rm -rf data/cache/*
service KARAF-service start
echo "features:install camel-blueprint camel-stream" | bin/client
cp /root/simple-camel-blueprint.xml  deploy/  && tail -f data/log/karaf.log
我得到:

***deleted startup messages***
2012-12-01 14:56:42,166 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
2012-12-01 14:56:47,134 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
2012-12-01 14:56:52,135 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
2012-12-01 14:56:57,135 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
2012-12-01 14:57:02,135 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
2012-12-01 14:57:07,136 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
2012-12-01 14:57:12,135 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
2012-12-01 14:57:17,135 | INFO  | - timer://simple | test                             | 64 - org.apache.camel.camel-core - 2.9.4 | Exchange[ExchangePattern:InOnly, BodyType:String, Body:Hello World]
如果我将“to uri”从“log:test”更改为“stream:out”,那么运行bin/client,我什么也得不到。这是一个有效的控制台输出测试吗

我还要补充一点:

karaf@root> camel:route-info route3
Camel Route route3
    Camel Context: simple

Properties 
        id = route3
        parent = 7fcb9c0a

Statistics
    Exchanges Total: 5
    Exchanges Completed: 5
    Exchanges Failed: 0
    Min Processing Time: 1ms
    Max Processing Time: 5ms
    Mean Processing Time: 1ms
    Total Processing Time: 9ms
    Last Processing Time: 1ms
    Load Avg: 0.00, 0.00, 0.00
    First Exchange Date: 2012-12-01 15:08:32
    Last Exchange Completed Date: 2012-12-01 15:08:52

Definition
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route id="route3" xmlns="http://camel.apache.org/schema/spring">
    <from uri="timer:simple?period=5000"/>
    <setBody id="setBody3">
        <simple>Hello World</simple>
    </setBody>
    <to uri="stream:out" id="to3"/>
</route>
karaf@root>骆驼:路线信息路线3
骆驼路线3
骆驼上下文:简单
性质
id=路由3
父级=7fcb9c0a
统计
总数:5
完成的交流:5
交换失败:0
最小处理时间:1ms
最长处理时间:5毫秒
平均处理时间:1ms
总处理时间:9毫秒
最后处理时间:1ms
平均载荷:0.00,0.00,0.00
首次交换日期:2012-12-01 15:08:32
上次交换完成日期:2012-12-01 15:08:52
定义
你好,世界

您使用哪种驼峰和卡拉夫版本


您是否安装了驼峰流功能?在安装和启动您自己的捆绑包之前,您需要这样做。

您使用哪种Camel和Karaf版本


您是否安装了驼峰流功能?在安装和启动自己的捆绑包之前,您需要这样做。

谢谢您的反馈!当我在提高我的原始帖子的质量时,我学到了一些有趣的东西:)我用christian schneider在他的教程中使用的相同版本重新测试()。我还是不能让它工作。bin/client是测试stream:out的无效方法吗?啊,尝试使用bin/karaf在前台启动karaf作为shell。那么您就有了shell.ha中的输出流!有趣的这是一件很难找到的事情。非常感谢!谢谢你的反馈!当我在提高我的原始帖子的质量时,我学到了一些有趣的东西:)我用christian schneider在他的教程中使用的相同版本重新测试()。我还是不能让它工作。bin/client是测试stream:out的无效方法吗?啊,尝试使用bin/karaf在前台启动karaf作为shell。那么您就有了shell.ha中的输出流!有趣的这是一件很难找到的事情。非常感谢!
karaf@root> camel:route-info route3
Camel Route route3
    Camel Context: simple

Properties 
        id = route3
        parent = 7fcb9c0a

Statistics
    Exchanges Total: 5
    Exchanges Completed: 5
    Exchanges Failed: 0
    Min Processing Time: 1ms
    Max Processing Time: 5ms
    Mean Processing Time: 1ms
    Total Processing Time: 9ms
    Last Processing Time: 1ms
    Load Avg: 0.00, 0.00, 0.00
    First Exchange Date: 2012-12-01 15:08:32
    Last Exchange Completed Date: 2012-12-01 15:08:52

Definition
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route id="route3" xmlns="http://camel.apache.org/schema/spring">
    <from uri="timer:simple?period=5000"/>
    <setBody id="setBody3">
        <simple>Hello World</simple>
    </setBody>
    <to uri="stream:out" id="to3"/>
</route>