ActiveMQ5.0实战2: 基本配置
ActiveMQ5.0实战二: 基本配置注释关于XML配置中元素的具体信息可以参考http://activemq.apache.org/xbean
ActiveMQ5.0实战二: 基本配置
>
注释
关于XML配置中元素的具体信息可以参考http://activemq.apache.org/xbean-xml-reference-50.html下面介绍本篇配置使用的一些重要元素。
DispathPolicy
ActiveMQ支持3中不同的分发策略(避免翻译了以后误解,这里用原文):
- <roundRobinDispatchPolicy>:Simple dispatch policy that sends a message to every subscription that matches the message.
- <simpleDispatchPolicy>:Simple dispatch policy that sends a message to every subscription that matches the message.
- <strictOrderDispatchPolicy>:Dispatch policy that causes every subscription to see messages in the same order.
SubscriptionRecoveryPolicy
ActiveMQ支持6种恢复策略,可以自行选择使用不同的策略
- <fixedCountSubscriptionRecoveryPolicy>: keep a fixed count of last messages.
- <fixedSizedSubscriptionRecoveryPolicy>: keep a fixed amount of memory available in RAM for message history which is evicted in time order.
- <lastImageSubscriptionRecoveryPolicy>:only keep the last message.
- <noSubscriptionRecoveryPolicy>:disable recovery of messages.
- <queryBasedSubscriptionRecoveryPolicy>:perform a user specific query mechanism to load any messages they may have missed.
- <timedSubscriptionRecoveryPolicy>:keep a timed buffer of messages around in memory and use that to recover new subscriptions.
PersistenceAdapter
http://activemq.apache.org/persistence讲解了关于persistence的信息。ActiveMQ5.0使用AMQ Message Store持久化消息,这种方式提供了很好的性能(The AMQ Message Store is an embeddable transactional message storage solution that is extremely fast and reliable.) 默认使用该存储方式即可,如果想使用JDBC来存储,可以查找文档配置。
Summary
本篇文章只提供了基本配置信息。如果需要更多的文章,可以查看ActiveMQ的文档。
讲了安装和简单的配置,下一篇将介绍和Sping的整合,以及多个queue,多个topic,多个producer,多个consumer的配置,使用。