SpringBoot3.0整合RocketMQ时出现未能加载bean文件
问题
APPLICATION FAILED TO START
Description:
Field rocketMQTemplate in com.spt.message.service.MqProducerService 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.
解决方案
定义一个配置类
@Configuration
public class RocketMqConfig {