我的视频blog地址 http://www.lofter.com/blog/cloudrivers

Amazon SNS 消息属性

Name,Type,Value:名称、类型和值都不得为空或 null。此外,消息正文也不应为空或 null。消息属性的所有部分 (包括名称、类型和值) 都包含在消息大小限制中,该限制当前是 256 KB。

Amazon SNS 支持传输消息属性,消息属性可让您提供消息相关的结构化元数据项目(如时间戳、地理空间数据、签名和标识符)。每条消息最多可以包含 10 个属性。

订阅确认消息是一条 POST 消息,消息的主体包含了一个 JSON 格式文档及以下名称/值对。

Message

一个描述消息的字符串。为订阅确认,字符串看上去像这样:

 
You have chosen to subscribe to the topic arn:aws:sns:us-east-1:123456789012:MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.
MessageId

通用唯一标识符,它对于每个发布的通知是唯一的。对于 Amazon SNS 在重试期间重新发送的消息,原始消息的消息 ID 被使用。

Signature

Message、MessageId、Type、Timestamp 和 TopicArn 值的 Base64 编码“SHA1withRSA”签名。

SignatureVersion

所用 Amazon SNS 签名的版本。

SigningCertURL

用于签署消息的证书的 URL。

SubscribeURL

为了确认订阅而必须访问的 URL。或者,您可以使用Token ConfirmSubscription 操作确认订阅。

Timestamp

订阅确认发出的时间 (GMT)。

Token

您可以使用 ConfirmSubscription 操作确认订阅的一个值。或者,您只需访问SubscribeURL

TopicArn

终端节点已经订阅该主题的 Amazon Resource Name。

Type

消息类型。为订阅确认,消息类型为:SubscriptionConfirmation

下列 HTTP POST 消息是向 HTTP 终端节点发送 SubscriptionConfirmation 消息的一个样例。

 

 

 1 POST / HTTP/1.1
 2 x-amz-sns-message-type: SubscriptionConfirmation
 3 x-amz-sns-message-id: 165545c9-2a5c-472c-8df2-7ff2be2b3b1b
 4 x-amz-sns-topic-arn: arn:aws:sns:us-west-2:123456789012:MyTopic
 5 Content-Length: 1336
 6 Content-Type: text/plain; charset=UTF-8
 7 Host: myhost.example.com
 8 Connection: Keep-Alive
 9 User-Agent: Amazon Simple Notification Service Agent
10 
11 {
12   "Type" : "SubscriptionConfirmation",
13   "MessageId" : "165545c9-2a5c-472c-8df2-7ff2be2b3b1b",
14   "Token" : "2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736",
15   "TopicArn" : "arn:aws:sns:us-west-2:123456789012:MyTopic",
16   "Message" : "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:123456789012:MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.",
17   "SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:123456789012:MyTopic&Token=2336412f37fb687f5d51e6e241d09c805a5a57b30d712f794cc5f6a988666d92768dd60a747ba6f3beb71854e285d6ad02428b09ceece29417f1f02d609c582afbacc99c583a916b9981dd2728f4ae6fdb82efd087cc3b7849e05798d2d2785c03b0879594eeac82c01f235d0e717736",
18   "Timestamp" : "2012-04-26T20:45:04.751Z",
19   "SignatureVersion" : "1",
20   "Signature" : "EXAMPLEpH+DcEwjAPg8O9mY8dReBSwksfg2S7WKQcikcNKWLQjwu6A4VbeS0QHVCkhRS7fUQvi2egU3N858fiTDN6bkkOxYDVrY0Ad8L10Hs3zH81mtnPk5uvvolIC1CXGu43obcgFxeL3khZl8IKvO61GWB6jI9b5+gLPoBc1Q=",
21   "SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem"
22   }

 

posted @ 2019-08-28 14:23  Michael云擎  阅读(607)  评论(0编辑  收藏  举报
我的视频blog地址 http://www.lofter.com/blog/cloudrivers