环境:MAC OS X 10.11.5 + ActiveMQ 5.13.3
1. 平均分发消息:Round Robin Dispatch Policy
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic="FOO.>">
<dispatchPolicy>
<roundRobinDispatchPolicy />
</dispatchPolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
2. 以相同顺序接收消息:Strict Order Dispatch Policy
保证每个 Topic 订阅者以相同的顺序接收消息,代价是性能上的损失。
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic="ORDERS.>">
<dispatchPolicy>
<strictOrderDispatchPolicy />
</dispatchPolicy>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
参考文献:
1. http://whitesock.iteye.com/blog/165458
没有评论:
发表评论