use of com.aliyun.mns.client.CloudTopic in project jeesuite-libs by vakinge.
the class MNSProducer method getTopic.
public CloudTopic getTopic(String topicName) {
if (!topics.containsKey(topicName)) {
synchronized (this) {
if (!topics.containsKey(topicName)) {
CloudTopic topic = MNSClientInstance.createTopicIfAbsent(topicName, null);
topics.put(topicName, topic);
}
}
}
return topics.get(topicName);
}
use of com.aliyun.mns.client.CloudTopic 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();
}
use of com.aliyun.mns.client.CloudTopic in project jeesuite-libs by vakinge.
the class MNSProducer method getTopic.
public CloudTopic getTopic(String topicName) {
if (!topics.containsKey(topicName)) {
synchronized (this) {
if (!topics.containsKey(topicName)) {
CloudTopic topic = MNSClientInstance.createTopicIfAbsent(topicName, null);
topics.put(topicName, topic);
}
}
}
return topics.get(topicName);
}
Aggregations