AWS SNS 响应处理

AWS SNS response handling

我是为我的 Java 程序实施 AWS SNS SMS 网关的新手。向AWS发布消息成功后,我想知道消息是否发送?它总是用 messageId 给出响应,即使消息发送失败。是否有任何具体方法或API为此公开?

来自SNS FAQ

Q: How do I track the delivery status of my SMS messages?

By enabling the Delivery Status feature in Amazon SNS, you can get information on the following for each message: MessageID, Time Sent, Destination Phone Number, Disposition, Disposition Reason (if applicable), Price, and Dwell Time.

文档中的换句话说:

Amazon Simple Notification Service (Amazon SNS) provides support to log the delivery status of push notification messages. After you configure application attributes, log entries will be sent to CloudWatch Logs for messages sent from Amazon SNS to mobile endpoints. Logging message delivery status helps provide better operational insight, such as the following: * Know whether a push notification message was delivered from Amazon SNS to the push notification service. * Identify the response sent from the push notification service to Amazon SNS. * Determine the message dwell time (the time between the publish timestamp and just before handing off to a push notification service).

参考,检查代码示例: https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html

看来您要为此使用 cloudwatch。您从 API 获得的 messageid 当然对过滤信息很有用。

我建议你开一张AWS支持的工单(因为你进一步的问题作为评论): 对于专业支持,我建议与他们一起立案:https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-sns-text-messaging