不写发短信的方法了,这个搜一下一大把
调用接收队列方法,也是对照官方的demo
@Autowired
private MessageUp messageUp;
@RequestMapping("/message_phone/getMessage.do")
public String getMessage(){
try {
DefaultAlicomMessagePuller puller=new DefaultAlicomMessagePuller();
String messageType="SmsUp";
String accessKeyId="xxxxxxxxxxxx";
String accessKeySecret="xxxxxxxxxxxxxxxxxxx";
String queueName="Alicom-Queue-xxxxxxxxxxxxxxxx-SmsUp";
puller.startReceiveMsg
(accessKeyId,accessKeySecret ,messageType,queueName , messageUp);
} catch (Exception e) {
e.printStackTrace();
}
return "redirect:HZ/v_list.do";
}