JMS主题与队列 [英] JMS Topic vs Queues
问题描述
我想知道JMS队列和JMS主题之间有什么区别.
I was wondering what is the difference between a JMS Queue and JMS Topic.
主题
在JMS中,主题实现发布和订阅语义.当您发布消息时,消息将发送给所有 感兴趣-因此零到许多订户将收到一份 信息.当时只有有效订阅的订阅者 经纪人收到消息后,将获得消息的副本.
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.
JMS队列实现负载均衡器语义.一条消息将恰好由一个消费者接收.如果没有 消息发送时可用的消费者将被保留 直到有一个可以处理该消息的使用者为止.如果一个 消费者收到一条消息,并且在关闭前不确认该消息 然后邮件将重新发送给其他使用者.队列可以 有许多消费者在可用范围内具有负载均衡消息 消费者.
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.
我想拥有某种东西",它将以与ActiveMQ代理接收消息的顺序相同的顺序向每个订阅者发送消息的副本.
I want to have 'something' what will send a copy of the message to each subscriber in the same sequence as that in which the message was received by the ActiveMQ broker.
有什么想法吗?
推荐答案
这意味着一个合适的主题.队列意味着一条消息发给一个,并且只有一个可能的订户.每个用户都有一个话题.
That means a topic is appropriate. A queue means a message goes to one and only one possible subscriber. A topic goes to each and every subscriber.
这篇关于JMS主题与队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!