public class MQProducer extends Object
| 限定符 | 构造器和说明 |
|---|---|
protected |
MQProducer(String instanceId,
String topicName,
com.aliyun.mq.http.common.http.ServiceClient client,
com.aliyun.mq.http.common.auth.ServiceCredentials credentials,
URI endpoint) |
| 限定符和类型 | 方法和说明 |
|---|---|
AsyncResult<TopicMessage> |
asyncPublishMessage(TopicMessage msg,
AsyncCallback<TopicMessage> callback)
async publish message to topic
so, when you receive this message, you should do base64 decode before use it.
|
String |
getInstanceId() |
String |
getTopicName() |
TopicMessage |
publishMessage(TopicMessage msg)
publish message to topic
|
String |
toString() |
protected MQProducer(String instanceId, String topicName, com.aliyun.mq.http.common.http.ServiceClient client, com.aliyun.mq.http.common.auth.ServiceCredentials credentials, URI endpoint)
instanceId, - instance idtopicName, - topic nameclient, - ServiceClient objectcredentials, - ServiceCredentials objectendpoint, - user mq http endpoint, ie: http://uid.mqrest.region.aliyuncs.com/public String getTopicName()
public String getInstanceId()
public TopicMessage publishMessage(TopicMessage msg) throws ServiceException, ClientException
msg - messageServiceException - Exception from serverClientException - Exception from clientpublic AsyncResult<TopicMessage> asyncPublishMessage(TopicMessage msg, AsyncCallback<TopicMessage> callback)
msg - messagecallback, - user callback objectCopyright © 2019. All Rights Reserved.