1. 程式人生 > >Bean method rocketMQTemplate in RocketMQAutoConfiguration not loaded坑

Bean method rocketMQTemplate in RocketMQAutoConfiguration not loaded坑

一、 異常棧

***************************
APPLICATION FAILED TO START
***************************

Description:

A component required a bean of type 'org.apache.rocketmq.spring.core.RocketMQTemplate' that could not be found.

The following candidates were found but could not be injected:
	- Bean method 'rocketMQTemplate' in 'RocketMQAutoConfiguration' not loaded because @ConditionalOnBean (types: org.apache.rocketmq.client.producer.DefaultMQProducer; SearchStrategy: all) did not find any beans of type org.apache.rocketmq.client.producer.DefaultMQProducer


Action:

Consider revisiting the entries above or defining a bean of type 'org.apache.rocketmq.spring.core.RocketMQTemplate' in your configuration.

追蹤到是DefaultMQProducer配置問題

二、 開啟RocketMQAutoConfiguration

配置生效需要設定rocketmq.producer.group屬性

application.yml