首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

ActiveMQ中topic跟queue的区别

2013-11-18 
ActiveMQ中topic和queue的区别官方网站已经解释得很清楚了:http://activemq.apache.org/how-does-a-queue-

ActiveMQ中topic和queue的区别

官方网站已经解释得很清楚了:

http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html

?

?

Topics

In JMS a Topic implements publish and subscribe semantics. When you publish a message it goes to all the subscribers who are interested - so zero to many subscribers will receive a copy of the message. Only subscribers who had an active subscription at the time the broker receives the message will get a copy of the message.

Queues

A JMS Queue implements load balancer semantics. A single message will be received by exactly one consumer. If there are no consumers available at the time the message is sent it will be kept until a consumer is available that can process the message. If a consumer receives a message and does not acknowledge it before closing then the message will be redelivered to another consumer. A queue can have many consumers with messages load balanced across the available consumers.

So Queues implement a reliable load balancer in JMS.

热点排行