我知道Spring,但我是JMS方面的新手,并开始阅读Spring。在Spring 春季医生中,我阅读了以下内容
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,会发生什么?
发布于 2013-05-08 18:50:34
每个订阅者接收发布到Topic的每个消息的副本。设置多个使用者是毫无意义的,因为您的应用程序只需要在不同的线程中10次接收相同的消息。
对于Queue,队列上的消息将分布在10个线程之间,因此并发处理。这确实是一个非常常见的场景--负载平衡。
https://stackoverflow.com/questions/16418002
复制相似问题