本篇文章为大家展示了 怎样解决RocketMQAutoConfiguration中的Bean方法rocketMQTemplate未加载的问题,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。
一、 异常栈
***************************
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
中加入默认即可
上述内容就是 怎样解决RocketMQAutoConfiguration中的Bean方法rocketMQTemplate未加载的问题,你们学到知识或技能了吗?如果还想学到更多技能或者丰富自己的知识储备,欢迎关注天达云行业资讯频道。