<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

    2015年4月10日

    在本章我們介紹在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。

    posted @ 2015-04-10 15:37 xiaolang 閱讀(5174) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 亚洲精华国产精华精华液好用| 亚洲男人天堂影院| 美女视频黄频a免费| 拨牐拨牐x8免费| 亚洲性无码AV中文字幕| 性感美女视频免费网站午夜 | 国产激情久久久久影院老熟女免费| 国产精品四虎在线观看免费| 亚洲a无码综合a国产av中文| 全黄a免费一级毛片人人爱| 亚洲AV无码一区二区三区电影| 国产免费资源高清小视频在线观看| MM1313亚洲精品无码久久| 亚洲综合最新无码专区| 很黄很污的网站免费| 亚洲精品人成电影网| 毛片a级毛片免费播放下载| 免费无遮挡无码视频在线观看| 国产亚洲精品成人a v小说| 全免费a级毛片免费看| 美女被羞羞网站免费下载| 亚洲第一页日韩专区| 怡红院免费的全部视频| 久久亚洲日韩看片无码| 性一交一乱一视频免费看| 七次郎成人免费线路视频| 久久精品国产亚洲AV高清热| 拍拍拍又黄又爽无挡视频免费| 成人免费网站视频www| 久久99国产亚洲精品观看| 国产精品成人免费一区二区| 美女被免费视频网站| 亚洲精品国产成人专区| 天天拍拍天天爽免费视频| 中文字幕免费观看全部电影| 亚洲无人区视频大全| 亚洲国产激情一区二区三区| 2019中文字幕免费电影在线播放 | 波多野结衣久久高清免费 | 一级特黄色毛片免费看| 亚洲精品中文字幕乱码|