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

注:在此感謝原文作者。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章