JmsTemplate 注入失败,解决方法

JmsTemplate 注入失败,解决方法

检查是否开启了mq池时没导入对应的pool-jms包

#开启池造成注入失败
spring.activemq.pool.enabled=true
spring.activemq.pool.max-connections=10

可以选择关闭

spring.activemq.pool.enabled=false
spring.activemq.pool.max-connections=10

或者引入对于的包

springboot 2.1+及以上,maven配置依赖

<dependency>
	<groupId>org.messaginghub</groupId>
	<artifactId>pooled-jms</artifactId>
</dependency>

使用springboot2.0+及以下版本时候,maven配置依赖:

<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-pool</artifactId>
</dependency>

猜你喜欢

转载自blog.csdn.net/Little_Matches/article/details/125282067