Bootstrap

required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate'

问题描述:关于springboot2.1.*整合activemq时报错:required a bean of type 'org.springframework.jms.core.JmsMessagingTemplate'。

搜索网上有些有些人文件的配置信息由空格什么的,没能解决。

搜索到一篇正解的文章,完美解决:原因是springboot2.1.x和springboot2.0.x源码原因导致。

我这边解决:

<!-- 整合消息队列ActiveMQ -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-activemq</artifactId>
</dependency>

<!-- 如果配置线程池则加入 -->
<dependency>
    <groupId>org.messaginghub</groupId>
    <artifactId>pooled-jms</artifactId>
</dependency>
<!--<dependency>-->
    <!--<groupId>org.apache.activemq</groupId>-->
    <!--<artifactId>activemq-pool</artifactId>-->
<!--</dependency>-->

配置线程池依赖改用:<dependency> <groupId>org.messaginghub</groupId> <artifactId>pooled-jms</artifactId> </dependency>

即可。

文章链接:https://www.jianshu.com/p/bb396bf573bd

注:在此感谢原文作者。

;