<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    吳密的博客

    每天進步一點點
    posts - 12, comments - 1, trackbacks - 0, articles - 1
    在本章我們介紹在serviceMIx 中圖和使用 ActiveMQ、features命令,入門的3篇文章來自
    http://servicemix.apache.org/docs/5.0.x/quickstart/index.html,有興趣的可以再去看看英文的。

    ActiveMQ
        每個
    Apache ServiceMix的實例是一個嵌入式activemq jms代理,這樣可以很方便的在同一臺機器上使用持久消息來通信,
    但是它也支持集群和負載均衡。
       在這個實例中,我們依然像上個例子一樣,在2個目錄中移動文件,把記錄日志的部分改為發送一條jms消息到消息隊列,
    然后再創建一個新的route來接受事件并記錄日志:
    ?xml version="1.0" encoding="UTF-8"?>
    <blueprint
        xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
          http://www.osgi.org/xmlns/blueprint/v1.0.0
          http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
          <route>
            <from uri="file:activemq/input"/>
            <to uri="file:activemq/output"/>

            <setBody>
              <simple>
                FileMovedEvent(file: ${file:name}, timestamp: ${date:now:hh:MM:ss.SSS})
              </simple>
            </setBody>
            <to uri="activemq://events" />
          </route>
        </camelContext>
    </blueprint>

       保存這個文件,并且放到serviceMix的deploy目錄,會看到復制到 activemq/input 目錄中的文件被復制到 activemq/output 

       接受消息
       在第一個文件中,除了復制文件,你看不到任何的log記錄。它發送了jms消息,但是沒有接受者,我們可以創建一個route來接受消息:

    <?xml version="1.0" encoding="UTF-8"?>
    <blueprint
        xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
          http://www.osgi.org/xmlns/blueprint/v1.0.0
          http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
          <route>
            <from uri="activemq://events"/>
            <to uri="log:events"/>
          </route>
        </camelContext>
    </blueprint>

      你可以通過log:display來查看日志消息。你可以通過osgi:start 和 osgi:stop來啟動和關閉這個bundle.當你重啟完第一個bundle后,你收到所有文件移動后發出
    的消息事件。

        features命令

    karaf@root> features:list | grep camel
    [uninstalled] [5.4.0           ] examples-activiti-camel                 servicemix-examples-5.4.0
    [uninstalled] [5.4.0           ] examples-akka-camel                     servicemix-examples-5.4.0


    karaf@root> features:install webconsole

    karaf@root> features:list | grep webconsole
    [installed  ] [2.4.1           ] webconsole                              karaf-2
    .4.1               Karaf WebConsole for administration and monitoring

        通過features:install webconsole可以安裝  webconsole bundle,成功后你可以通過  http://localhost:8181/system/console  用戶名密碼:smx/smx來
    登錄
    ,可以通過瀏覽器來上傳、啟動,停止bundle。


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 精品亚洲456在线播放| 久久青草亚洲AV无码麻豆| 亚洲H在线播放在线观看H| 久久久久久夜精品精品免费啦 | 免费无码又爽又刺激高潮软件| 免费v片视频在线观看视频| 人人公开免费超级碰碰碰视频| 亚洲国产成人精品女人久久久 | jizz在线免费观看| 亚洲精品专区在线观看| 亚欧国产一级在线免费| 国产成人亚洲综合无码精品| 一级毛片不卡片免费观看| 亚洲欧洲日本天天堂在线观看| 成人AV免费网址在线观看| 亚洲av永久无码天堂网| 亚洲av高清在线观看一区二区| 黄色视屏在线免费播放| 亚洲AV日韩AV永久无码下载| 国产无人区码卡二卡三卡免费| 亚洲sm另类一区二区三区| 亚洲一区二区三区乱码A| 久久精品免费电影| 亚洲精品一卡2卡3卡三卡四卡| 一二三四影视在线看片免费 | 亚洲欧洲日本在线观看| 国产免费av一区二区三区| 国产成人高清精品免费观看| 亚洲国产精品人久久| 黄色成人网站免费无码av| 青草青草视频2免费观看| 亚洲理论电影在线观看| 一级片在线免费看| 久久亚洲免费视频| 妞干网免费观看视频| 精品人妻系列无码人妻免费视频 | wwwxxx亚洲| 久久亚洲欧洲国产综合| 免费A级毛片无码A∨免费| 国产精品手机在线亚洲| 久久精品亚洲中文字幕无码网站|