public static void main(String[] args) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("producer/producer.xml");
HttpMQProducerServiceImpl producer = context.getBean(HttpMQProducerServiceImpl.class);
// 发送定时消息: producer.send("msg", "tag", "key", startDeliverTime);
Long timeStamp=null;
try {
timeStamp =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2017-02-16 10:26:00").getTime();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (producer.sendMessage("nihao","meinu","什么",timeStamp)) {
System.out.println("send message success");
} else {
System.out.println("send message failed");
}
//context.close();
}
https://help.aliyun.com/document_detail/29550.html
检查你的时间戳,要考虑时区。