<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個目錄中移動文件,把記錄日志的部分改為發(fā)送一條jms消息到消息隊列,
    然后再創(chuàng)建一個新的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記錄。它發(fā)送了jms消息,但是沒有接受者,我們可以創(chuàng)建一個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后,你收到所有文件移動后發(fā)出
    的消息事件。

        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。


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


    網(wǎng)站導航:
    博客園   IT新聞   Chat2DB   C++博客   博問  
     
    主站蜘蛛池模板: 国产亚洲美女精品久久久久| 国产V片在线播放免费无码 | 最近2022中文字幕免费视频| 亚洲欧洲日本在线观看| 免费在线黄色网址| 777爽死你无码免费看一二区| 亚洲女女女同性video| 亚洲精品卡2卡3卡4卡5卡区| 无码国产精品一区二区免费I6| 国产福利电影一区二区三区,免费久久久久久久精 | 亚洲成AV人片在WWW| 国产亚洲精品自在久久| 成人免费视频网址| 好久久免费视频高清| 亚洲狠狠婷婷综合久久| 亚洲av无码乱码国产精品fc2| 夫妻免费无码V看片| 无码人妻丰满熟妇区免费| 白白色免费在线视频| 亚洲依依成人精品| 亚洲国产精品无码久久一区二区| 成人免费看片又大又黄| 久久免费高清视频| 午夜不卡AV免费| 亚洲日韩国产二区无码| 337p日本欧洲亚洲大胆艺术| 精品亚洲一区二区三区在线播放| 国产精品成人观看视频免费| 中文字幕在线免费视频| 羞羞网站在线免费观看| 中文字幕 亚洲 有码 在线 | 亚洲日本在线观看| 亚洲情侣偷拍精品| 永久黄网站色视频免费| 国产成人免费午夜在线观看| AAAAA级少妇高潮大片免费看| 九九精品国产亚洲AV日韩| 亚洲乱码一二三四区国产| 亚洲嫩模在线观看| 亚洲精品无码AV人在线播放| 免费a级黄色毛片|