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

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

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

    Terry.Li-彬

    虛其心,可解天下之問;專其心,可治天下之學(xué);靜其心,可悟天下之理;恒其心,可成天下之業(yè)。

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      143 隨筆 :: 344 文章 :: 130 評(píng)論 :: 0 Trackbacks

    2.3 Persistence
    2.3.1 AMQ Message Store
    ??? AMQ Message Store是ActiveMQ5.0缺 省的持久化存儲(chǔ)。Message commands被保存到transactional journal(由rolling data logs組成)。Messages被保存到data logs中,同時(shí)被reference store進(jìn)行索引以提高存取速度。Date logs由一些單獨(dú)的data log文件組成,缺省的文件大小是32M,如果某個(gè)消息的大小超過了data log文件的大小,那么可以修改配置以增加data log文件的大小。如果某個(gè)data log文件中所有的消息都被成功消費(fèi)了,那么這個(gè)data log文件將會(huì)被標(biāo)記,以便在下一輪的清理中被刪除或者歸檔。以下是其配置的一個(gè)例子:

    Xml代碼
    1. < broker ? brokerName = "broker" ? persistent = "true" ? useShutdownHook = "false" > ??
    2. ??<persistenceAdapter>??
    3. ?????<amqPersistenceAdapter?directory="${activemq.base}/data"?maxFileLength="32mb"/>??
    4. ??</persistenceAdapter>??
    5. </ broker > ??
    Property name Default value Comments
    directory activemq-data the path to the directory to use to store the message store data and log files
    useNIO true use NIO to write messages to the data logs
    syncOnWrite false sync every write to disk
    maxFileLength 32mb a hint to set the maximum size of the message data logs
    persistentIndex true use a persistent index for the message logs. If this is false, an in-memory structure is maintained
    maxCheckpointMessageAddSize 4kb the maximum number of messages to keep in a transaction before automatically committing
    cleanupInterval 30000 time (ms) before checking for a discarding/moving message data logs that are no longer used
    indexBinSize 1024 default number of bins used by the index. The bigger the bin size - the better the relative performance of the index
    indexKeySize 96 the size of the index key - the key is the message id
    indexPageSize 16kb the size of the index page - the bigger the page - the better the write performance of the index
    directoryArchive archive the path to the directory to use to store discarded data logs
    archiveDataLogs false if true data logs are moved to the archive directory instead of being deleted

    ?

    2.3.2 Kaha Persistence
    ??? Kaha Persistence 是一個(gè)專門針對(duì)消息持久化的解決方案。它對(duì)典型的消息使用模式進(jìn)行了優(yōu)化。在Kaha中,數(shù)據(jù)被追加到data logs中。當(dāng)不再需要log文件中的數(shù)據(jù)的時(shí)候,log文件會(huì)被丟棄。以下是其配置的一個(gè)例子:

    Xml代碼
    1. < broker ? brokerName = "broker" ? persistent = "true" ? useShutdownHook = "false" > ??
    2. ??????<persistenceAdapter>??
    3. ????????<kahaPersistenceAdapter?directory="activemq-data"?maxDataFileLength="33554432"/>??
    4. ??????</persistenceAdapter>??
    5. </ broker > ??

    ?

    2.3.3 JDBC Persistence
    ??? 目前支持的數(shù)據(jù)庫有Apache Derby, Axion, DB2, HSQL, Informix, MaxDB, MySQL, Oracle, Postgresql, SQLServer, Sybase。
    ??? 如果你使用的數(shù)據(jù)庫不被支持,那么可以調(diào)整StatementProvider 來保證使用正確的SQL方言(flavour of SQL)。通常絕大多數(shù)數(shù)據(jù)庫支持以下adaptor:

    • org.activemq.store.jdbc.adapter.BlobJDBCAdapter
    • org.activemq.store.jdbc.adapter.BytesJDBCAdapter
    • org.activemq.store.jdbc.adapter.DefaultJDBCAdapter
    • org.activemq.store.jdbc.adapter.ImageJDBCAdapter

    ?? 也可以在配置文件中直接指定JDBC adaptor,例如:

    Xml代碼
    1. < jdbcPersistenceAdapter ?? adapterClass = "org.apache.activemq.store.jdbc.adapter.ImageBasedJDBCAdaptor" /> ??
    ??? 以下是其配置的一個(gè)例子:

    ?

    Xml代碼
    1. <persistence>??
    2. ??????<jdbcPersistence?dataSourceRef="?mysql-ds"/>??
    3. </persistence>??
    4. ??
    5. <bean?id="mysql-ds"?class="org.apache.commons.dbcp.BasicDataSource"?destroy-method="close">??
    6. ??????<property?name="driverClassName"?value="com.mysql.jdbc.Driver"/>??
    7. ??????<property?name="url"?value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>??
    8. ??????<property?name="username"?value="activemq"/>??
    9. ??????<property?name="password"?value="activemq"/>??
    10. ??????<property?name="poolPreparedStatements"?value="true"/>??
    11. </bean>??

    ??? 需要注意的是,如果使用MySQL,那么需要設(shè)置relaxAutoCommit 標(biāo)志為true。

    ?

    2.3.4 Disable Persistence
    ??? 以下是其配置的一個(gè)例子:

    Xml代碼
    1. <broker?persistent="false">??
    2. </broker>
    posted on 2010-09-01 22:26 禮物 閱讀(546) 評(píng)論(0)  編輯  收藏 所屬分類: ActiveMQ

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

    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 有码人妻在线免费看片| 亚洲喷奶水中文字幕电影 | 免费人成视频在线播放| 亚洲欧美不卡高清在线| 亚洲日韩国产AV无码无码精品 | 国产精品亚洲玖玖玖在线观看| 免费看国产一级片| 亚洲精品高清一二区久久| 亚洲男女内射在线播放| 中文字幕中韩乱码亚洲大片| 亚洲中文字幕第一页在线| 亚洲色精品vr一区二区三区| 亚洲男人的天堂www| 九月丁香婷婷亚洲综合色| 亚洲精品私拍国产福利在线| 久久久久亚洲AV无码专区首JN| 亚洲欧洲日产国码二区首页| 亚洲一区二区三区久久久久| 亚洲人成色99999在线观看| 午夜亚洲国产精品福利| 中国内地毛片免费高清| 99re在线精品视频免费| 在线观看免费人成视频色9| 日韩免费观看视频| 国产亚洲情侣一区二区无码AV| 国产亚洲精品资源在线26u| 久久久久亚洲AV成人无码网站| 亚洲无限乱码一二三四区| 亚洲欧美综合精品成人导航| 高h视频在线免费观看| 亚洲精品线路一在线观看| 青青草原亚洲视频| 久久精品蜜芽亚洲国产AV| 伊人久久五月丁香综合中文亚洲| 男女超爽视频免费播放| 日本免费A级毛一片| 在线v片免费观看视频| 亚洲欧洲自拍拍偷精品 美利坚| 久久国产亚洲电影天堂| 亚洲一区欧洲一区| 人人爽人人爽人人片av免费 |