serverless-offline-sns icon indicating copy to clipboard operation
serverless-offline-sns copied to clipboard

Add basic SNS Delivery Policy implementation

Open timothepearce opened this issue 5 years ago • 2 comments

Statement

It seems that SNS has a default delivery policy that is not applied in the plugin.

https://github.com/mj1618/serverless-offline-sns/blob/884298b3d25ade67eb636d44c95d6ee2ec63561d/src/sns-server.ts#L248-L260 The catched request is only logged, no other behavior is implemented.

Question

Do you think this behavior deserves to be implemented in it? If so, in what form?

Proposal

I think it would be interesting to keep the current behavior of the plugin and add a custom variable to modify it if necessary.

custom:
  serverless-offline-sns:
    retry: 3 # default 0
    retry-interval: 1000 # In ms, default 0

With a retry custom attribute set to 3 and retry-interval set to 1000, we will send again each initial delivery attempt following the rules of the SNS Delivery Policy.

What do you think about it?

timothepearce avatar Aug 19 '19 13:08 timothepearce

I like it - feel free to raise a PR.

mj1618 avatar Dec 02 '19 15:12 mj1618

Sorry for the delayed response

mj1618 avatar Dec 02 '19 15:12 mj1618