首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring中JMS主题侦听器中的并发值

Spring中JMS主题侦听器中的并发值
EN

Stack Overflow用户
提问于 2013-05-07 11:36:16
回答 1查看 871关注 0票数 3

我知道Spring,但我是JMS方面的新手,并开始阅读Spring。在Spring 春季医生中,我阅读了以下内容

代码语言:javascript
复制
The number of concurrent sessions/consumers to start for each listener.
Can either be a simple number indicating the maximum number (e.g. "5") 
or a range indicating the lower as well as the upper limit (e.g. "3-5").  
Note that a specified minimum is just a hint and might be ignored at 
runtime. Default is 1; keep concurrency limited to 1 in case of a topic 
listener or if queue ordering is important; consider raising it for 
general queues.

只想了解为什么在主题侦听器的情况下,并发性仅限于1?如果我把它增加到10而不是1,会发生什么?

EN

回答 1

Stack Overflow用户

发布于 2013-05-08 18:50:34

每个订阅者接收发布到Topic的每个消息的副本。设置多个使用者是毫无意义的,因为您的应用程序只需要在不同的线程中10次接收相同的消息。

对于Queue,队列上的消息将分布在10个线程之间,因此并发处理。这确实是一个非常常见的场景--负载平衡。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16418002

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档