阿里云的消息服务怎么集成spring boot
1 回答
LEATH
TA贡献1936条经验 获得超6个赞
@Configuration
public class MnsConfig {
@Bean
public MNSClient getClient() {
CloudAccount account = new CloudAccount(
ServiceSettings.getMNSAccessKeyId(),
ServiceSettings.getMNSAccessKeySecret(),
ServiceSettings.getMNSAccountEndpoint());
MNSClient client = account.getMNSClient();
return client;
}
}
建一个配置类
使用的时候@Autowired
private MNSClient client 这样引入就可以了
- 1 回答
- 0 关注
- 1292 浏览
添加回答
举报
0/150
提交
取消