阿里云的消息服务怎么集成spring boot
Re阿里云的消息服务怎么集成spring boot
@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 这样引入就可以了
赞0
踩0