Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

Amazon SNS Service Push Notification delivered or not

I am using Aws SNS to send notification, and sending notifications to different topics and is working perfectly.

When i publish notification, i got array like

object(AwsResult)#84 (1) {
["data":"AwsResult":private]=>
array(2) {
    ["MessageId"]=>
    string(36) "************-7a29-591f-8765-************"
    ["@metadata"]=>
    array(4) {
        ["statusCode"]=>
        int(200)
        ["effectiveUri"]=>
        string(40) "https://sns.ap-southeast-1.amazonaws.com"
        ["headers"]=>
    array(4) {
        ["x-amzn-requestid"]=>
        string(36) "************-b737-5831-abf4-************"
        ["content-type"]=>
        string(8) "text/xml"
        ["content-length"]=>
        string(3) "294"
        ["date"]=>
        string(29) "Fri, 28 Oct 2016 08:59:05 GMT"
    }
    ["transferStats"]=>
        array(1) {
            ["http"]=>
            array(1) {
            [0]=>
               array(0) {}
            }
        }
    }
 }
}

I am using php at server side,

But i need to generate a report for each topic separately, that which endpoints (subscriber of topic) get notification and whether notifications are failed, and what is the percentage of successful delivery.

After a lot of research, i found that Aws CloudWatch can do my work, i also searched on stackOverflow for this, and got this answer:

How to confirm delivery status when using amazonSNS mobile push?

I also generated some log in CloudWatch, By describeLogGroups, i am getting array like

[logGroups] => Array(
[0] => Array
    (
        [logGroupName] => sns/ap-southeast-1/************/app/GCM/AndroidN
        [creationTime] => ************
        [retentionInDays] => 30
        [metricFilterCount] => 0
        [arn] => arn:aws:logs:ap-southeast-1:************:log-group:sns/ap-southeast-1/************/app/GCM/AndroidN:*
        [storedBytes] => 3133
     )
 )

By describeLogStreams, i am getting array like

[logStreams] => Array(
    [0] => Array
        (
            [logStreamName] => 25
            [creationTime] => 1477574852344
            [firstEventTimestamp] => 1477574831966
            [lastEventTimestamp] => 1477574831966
            [lastIngestionTime] => 1477574852374
            [uploadSequenceToken] => ***********************8
            [arn] => arn:aws:logs:ap-southeast-1:*********:log-group:sns/ap-southeast-1/**********/app/GCM/AndroidN:log-stream:25
            [storedBytes] => 627
        )
)

but confused that how to access it for a particular topic, because in my website i create some topics for group of users (endpoints), and now i want to show for every topic how much notification sent/failed to endpoints not to topic,

Thanks in Anticipants.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...