nervous-systems / fink-nottle

Asynchronous Clojure/Clojurescript client for Amazon's SNS & SQS services
The Unlicense
48 stars 4 forks source link

error handling? #14

Closed luposlip closed 8 years ago

luposlip commented 8 years ago

QUESTION:

Hi there,

Earlier on I simply checked if the returned data from SNS included a string (message ID). If it did, the message (seemed to be) sent successfully. I don't know if this has changed (on SNS or somewhere else). But the application endpoints on SNS stays enabled, and the CloudWatch log says the message has been delivered correctly, even though it's not true.

What are your thoughts on status checking the sent messages?

Best, Henrik

moea commented 8 years ago

What kind of endpoints are you publishing to with SNS? The SNS publish method returns an ID to indicate that the message has been received by SNS, but delivery to one or all endpoints can subsequently faiI.

As far as I know, there isn't a general mechanism within SNS to check on the status of individual deliveries, though for mobile push, it looks like you can use set-platform-application-attributes! (see http://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html) to specify a topic ARN to which delivery failures should be reported.

Are the logs in CloudWatch confirming successful delivery of the message to the endpoint, or receipt of the message by SNS?

luposlip commented 8 years ago

Hi @moea

I'm publishing to endpoints on both APNS and GCM. I think what I may have missed was to deregister the device tokens from the client (so Apple/Google knows the device tokens cannot be used anymore). Yesterday I forced the deregistration when logging off from my app. And now it seems that AWS SNS disables the endpoints that have been deregistered. When the endpoints are deregistered the publish from fink-nottle/sns doesn't return the message IDs anymore. This was how I initially checked if the publishing went fine or not. This seems to work again (at least for GCM, haven't tried the same with APNS yet).

As a side note - I've also activated the loggin from SNS to CloudWatch. The publishing even succeeds in the log files, even though the endpoint is not used anymore. So the on-device deregistering of the tokens is probably the only thing needed to have SNS disable the endpoints :)

Thanks for your reply.