Spring boot activeMQ 设置并行消费

Posted 疯子加天才

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring boot activeMQ 设置并行消费相关的知识,希望对你有一定的参考价值。

网上看的大部分都是是说

配置 SimpleMessageListenerContainer 的 concurrentConsumers属性来确定activeMQ有多少个消费者。

但是:

我用的是 spring boot  SimpleMessageListenerContainer 是自动配置的,并不可以通过配置的方式去改变这个属性。

解决办法:

通过 配置 jms来设置并行消费者
spring:
activemq:
user: admin
password: admin
broker-url: tcp://127.0.0.1:61616
pool:
enabled: true
max-connections: 50
packages:
trust-all: true
jms:
Listener:
# 默认开启多少个消费者
concurrency: 3
#在这里消费者是可以随动的。最大配置消费者并行最大数量
max-concurrency: 3
————————————————
版权声明:本文为CSDN博主「SUNbrightness」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/SUNbrightness/java/article/details/90110256

以上是关于Spring boot activeMQ 设置并行消费的主要内容,如果未能解决你的问题,请参考以下文章

如何使用 Spring Boot 配置嵌入式 ActiveMQ 代理 URL

Spring Boot学习笔记——Spring Boot与ActiveMQ的集成

activemq 学习系列 activemq 与 spring boot 整合

Camel ActiveMQ + Spring boot 不读取 spring activemq 配置

Spring Boot 整合 ActiveMQ

activeMQ入门+spring boot整合activeMQ