很多小伙伴在项目升级到springBoot3.0版本以上之后,整合很多中间件会有很多问题,下面带小伙伴解决springBoot3.0版本以上对于RocketMQ 不兼容问题
报错信息
*************************** APPLICATION FAILED TO START ***************************
Description:
Field rocketMQTemplate in com.dayuwebtech.dayupay.common.rocketmq.impl.SendPayReNotifyMessageImpl required a bean of type 'org.apache.rocketmq.spring.core.RocketMQTemplate' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action: Consider defining a bean of type 'org.apache.rocketmq.spring.core.RocketMQTemplate' in your configuration.
解决方法:
我们要在resources文件夹中,新建 META-INF/spring 文件夹,在里面新建一个叫org.springframework.boot.autoconfigure.AutoConfiguration.imports的文件里面填入 org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration
通过上述操作,项目正常启动