-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Description
Statement
It seems that SNS has a default delivery policy that is not applied in the plugin.
serverless-offline-sns/src/sns-server.ts
Lines 248 to 260 in 884298b
| private publishHttp(event, sub, raw) { | |
| return fetch(sub.Endpoint, { | |
| method: "POST", | |
| body: event, | |
| timeout: 0, | |
| headers: { | |
| "x-amz-sns-rawdelivery": "" + raw, | |
| "Content-Type": "text/plain; charset=UTF-8", | |
| "Content-Length": Buffer.byteLength(event), | |
| }, | |
| }).then(res => this.debug(res)) | |
| .catch(ex => this.debug(ex)); | |
| } |
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 0With 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?