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

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

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

    皮杜妮

      BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
      887 Posts :: 3 Stories :: 7 Comments :: 0 Trackbacks
    做系統(tǒng)集成新的方式,主要是消息處理機制,采用通道的方式。



    簡單的配置文件
    <beans:beans xmlns="http://www.springframework.org/schema/integration"
        xmlns:xsi
    ="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:beans
    ="http://www.springframework.org/schema/beans"
        xmlns:context
    ="http://www.springframework.org/schema/context"
        xsi:schemaLocation
    ="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
            http://www.springframework.org/schema/integration
            http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-2.5.xsd"
    >

        
    <!-- 啟動Message bus 消息服務(wù)總線 支持四個屬性 
                auto-startup[boolean是否自動啟動 default=true]如果設(shè)置false,則需要手動調(diào)用applicationContext.start()方法
                auto-create-channels[boolean是否自動注冊MessageChannel default=false],如果使用的MessagChannle不存在
                error-channel 設(shè)置錯誤時信息發(fā)送的MessageChannle,如果不設(shè)置,則使用DefaultErrorChannel
                dispatcher-pool-size 使用的啟動線程數(shù),默認為10
    -->
        
    <message-bus/>
        
    <!-- 啟動支持元數(shù)據(jù)標記 -->
        
    <annotation-driven/>
        
    <!-- 設(shè)置 @Component標識的元數(shù)據(jù)掃描包(package) -->
        
    <context:component-scan base-package="org.springframework.integration.samples.cafe"/>

            
    <!-- 下面啟動了四個 MessageChannel服務(wù) 處理接收發(fā)送端發(fā)過來的消息和把消息流轉(zhuǎn)到消息的消費端 -->
            
    <!-- 屬性說明: capacity 消息最大容量默認為100 publish-subscribe是否是發(fā)布訂閱模式,默認為否
                                            id bean的id名稱 datatype ? 
    -->
        
    <channel id="orders"/> <!-- 訂單Channel -->
        
    <channel id="drinks"/> <!-- 飲料訂單Channel,處理飲料的類別 -->
        
    <channel id="coldDrinks"/> <!-- 熱飲生產(chǎn)Channel -->
        
    <channel id="hotDrinks"/> <!-- 冷飲生產(chǎn)Channel -->

            
    <!-- 消息處理終端 接收 channel coldDrinks的消息后,執(zhí)行barista.prepareColdDrink方法 生產(chǎn)冷飲 -->
            
    <!-- 屬性說明: input-channel 接收消息的Channel必須 default-output-channel設(shè)置默認回復(fù)消息Channel
                                            handler-ref 引用bean的id名稱 handler-method Handler處理方法名(參數(shù)類型必須與發(fā)送消息的payLoad使用的一致)
                                            error-handler設(shè)置錯誤時信息發(fā)送的MessageChannle   reply-handler 消息回復(fù)的Channel 
    -->
        
    <endpoint input-channel="coldDrinks" handler-ref="barista"
                                             handler-method
    ="prepareColdDrink"/>

            
    <!-- 消息處理終端 接收 channel hotDrinks的消息后,執(zhí)行barista.prepareHotDrink方法 生產(chǎn)熱飲 -->
        
    <endpoint input-channel="hotDrinks" handler-ref="barista"
                                            handler-method
    ="prepareHotDrink"/>

            
    <!-- 定義一個啟動下定單操作的bean,它通過 channel orders下定單 -->
        
    <beans:bean id="cafe" class="org.springframework.integration.samples.cafe.Cafe">
            
    <beans:property name="orderChannel" ref="orders"/>
        
    </beans:bean>
    </beans:beans>
    posted on 2013-11-28 16:15 豬眼睛 閱讀(167) 評論(0)  編輯  收藏 所屬分類: Spring
    主站蜘蛛池模板: 无码乱人伦一区二区亚洲一| 亚洲黄色网址在线观看| 中文字幕无码日韩专区免费| 亚洲综合一区二区国产精品| 久久久www成人免费毛片| 免费国产va在线观看| 曰韩亚洲av人人夜夜澡人人爽| 全部免费毛片在线播放| 亚洲日韩AV一区二区三区四区| 亚洲国产a级视频| **毛片免费观看久久精品| 亚洲日韩国产欧美一区二区三区| 亚洲中文字幕视频国产| 亚欧色视频在线观看免费| 羞羞漫画在线成人漫画阅读免费| 在线电影你懂的亚洲| 亚洲成?v人片天堂网无码| 亚洲成人免费网址| 一级毛片无遮挡免费全部| 亚洲人成片在线观看| 亚洲精品高清一二区久久| 2021在线观看视频精品免费| 香蕉大伊亚洲人在线观看| 亚洲国产另类久久久精品黑人| 最近2022中文字幕免费视频| 亚洲欧美中文日韩视频| 亚洲色婷婷综合开心网| 免费在线观看h片| 午夜不卡AV免费| 亚洲av乱码一区二区三区香蕉 | 一级毛片不卡片免费观看| 亚洲中文字幕乱码一区| 免费一区二区视频| 99视频在线精品免费| 欧洲亚洲国产精华液| 亚洲精品在线播放| 热99re久久免费视精品频软件| 一个人免费观看视频在线中文| 亚洲美女中文字幕| 亚洲免费在线观看| 无码国产精品久久一区免费|