Search in sources :

Example 1 with RawTopicMessage

use of com.aliyun.mns.model.RawTopicMessage in project jeesuite-libs by vakinge.

the class MNSProducer method publishMessage.

public String publishMessage(String topicName, Object data) {
    CloudTopic topic = getTopic(topicName);
    TopicMessage tMessage = new RawTopicMessage();
    tMessage.setBaseMessageBody(new MQMessage(topicName, data).toMessageValue(true));
    topic.publishMessage(tMessage);
    return tMessage.getMessageId();
}
Also used : CloudTopic(com.aliyun.mns.client.CloudTopic) RawTopicMessage(com.aliyun.mns.model.RawTopicMessage) TopicMessage(com.aliyun.mns.model.TopicMessage) RawTopicMessage(com.aliyun.mns.model.RawTopicMessage) MQMessage(com.mendmix.amqp.MQMessage)

Example 2 with RawTopicMessage

use of com.aliyun.mns.model.RawTopicMessage in project jeesuite-libs by vakinge.

the class MNSProducer method publishMessage.

public String publishMessage(String topicName, Object data) {
    CloudTopic topic = getTopic(topicName);
    TopicMessage tMessage = new RawTopicMessage();
    tMessage.setBaseMessageBody(new MQMessage(topicName, data).toMessageValue(true));
    topic.publishMessage(tMessage);
    return tMessage.getMessageId();
}
Also used : CloudTopic(com.aliyun.mns.client.CloudTopic) RawTopicMessage(com.aliyun.mns.model.RawTopicMessage) TopicMessage(com.aliyun.mns.model.TopicMessage) RawTopicMessage(com.aliyun.mns.model.RawTopicMessage) MQMessage(com.jeesuite.amqp.MQMessage)

Aggregations

CloudTopic (com.aliyun.mns.client.CloudTopic)2 RawTopicMessage (com.aliyun.mns.model.RawTopicMessage)2 TopicMessage (com.aliyun.mns.model.TopicMessage)2 MQMessage (com.jeesuite.amqp.MQMessage)1 MQMessage (com.mendmix.amqp.MQMessage)1