Confirmation of HTTP endpoint for SNS Subscribers

Tags: , ,



When I create a SNS topic using cloud formation and at the same time configure a HTTP endpoint it is possible that the HTTP endpoint might not be functional at that time.

So is it possible to set the retrial for sending these confirmations requests at some later stage.

My use case is that the HTTP endpoint will be on one of my EC2 instances that is getting created as part of the same clodformation and then I use AWS CodeDeploy to deploy my webapp.

So its highly possible that the EC2 instance might not be fully initialized or the code deploy did not complete before the SNS tries to confirm the subscriber endpoint

Answer

Apparently, you can… by configuring the retry policy on the endpoint or the topic.

If Amazon SNS doesn’t receive a successful response from your endpoint, it attempts to deliver the message again. This applies to all messages, including the subscription confirmation message. By default, if the initial delivery of the message fails, Amazon SNS attempts up to three retries with a delay between failed attempts set at 20 seconds. Note that the message request times out at 15 seconds. This means that if the message delivery failure was caused by a timeout, Amazon SNS will retry approximately 35 seconds after the previous delivery attempt. If you don’t like the default delivery policy, you can set a different delivery policy on the endpoint. (emphasis added)

http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html



Source: stackoverflow