use of com.aliyun.mns.model.Message in project xnx3 by xnx3.
the class MNSUtil method putMessage.
/**
* 发送消息
* @param queueName 要发送消息的队列名字
* @param message 发送的消息对象
* @return {@link Message}
* <ul>
* <li>null : 失败</li>
* <li>不为null,返回 {@link Message}对象 : 成功</li>
* </ul>
*/
public Message putMessage(String queueName, Message message) {
try {
CloudQueue queue = getMNSClient().getQueueRef(queueName);
Message putMsg = queue.putMessage(message);
return putMsg;
} catch (ClientException ce) {
clientException(ce);
} catch (ServiceException se) {
serviceException(se);
} catch (Exception e) {
exception(e);
}
return null;
}
Aggregations