阅读963 返回首页    go 微信


NotifyContentFormat__基本概念_API使用手册_消息服务-阿里云

NotifyContenFormat 用于指定 MNS 向 Endpoint 推送消息时,消息内容的格式。

XML

  • 消息体为XML格式,包含消息正文和消息属性;
  • HttpEndpoint和QueueEndpoint支持该格式;
  • 消息示例:
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <Notification xlmns="https://mns.aliyuncs.com/doc/v1/">
    3. <TopicOwner>TopicOwner</TopicOwner>
    4. <TopicName>TopicName</TopicName>
    5. <Subscriber>Subscriber</Subscriber>
    6. <SubscriptionName>SubscriptionName</SubscriptionName>
    7. <MessageId>6CC4D900CA59A2CD-1-15180534A8F-200000002</MessageId>
    8. <Message>{1:"a", 2:"b"}</Message>
    9. <MessageMD5>F1E92841751D795AB325861034B5CB55</MessageMD5>
    10. <MessageTag>important</MessageTag>
    11. <PublishTime>1449556920975</MessagePublishTime>
    12. </Notification>

JSON

  • 消息体为JSON格式,包含消息正文和消息属性;
  • HttpEndpoint和QueueEndpoint支持该格式;
  • 消息示例:
    1. {
    2. "TopicOwner":"TopicOwner",
    3. "TopicName":"TopicName",
    4. "Subscriber":"Subscriber",
    5. "SubscriptionName":"SubscriptionName",
    6. "MessageId":"6CC4D900CA59A2CD-1-15180534A8F-200000002",
    7. "Message":"xxxxx",
    8. "MessageMD5":"F1E92841751D795AB325861034B5CB55",
    9. "MessageTag":"important",
    10. "PublishTime":"1449556920975"
    11. }

SIMPLIFIED

  • 消息体即用户发布的消息,不包含任何属性信息;
  • HttpEndpoint、QueueEndpoint、MailEndpoint均支持该格式;
  • 消息体示例:
    1. {1:"a", 2:"b"}

最后更新:2016-11-23 17:16:04

  上一篇:go NotifyStrategy__基本概念_API使用手册_消息服务-阿里云
  下一篇:go 请求结构__调用方式_API使用手册_消息服务-阿里云