-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable retries for webhooks (#2093)
* build(webhook-retries): create SQS queue in dev mode (1) (#1938) * feat(webhook-retries): add isRetryEnabled to model (2) (#1939) * feat(webhook-retries): produce and consume retries (3) (#1940) * test(webhook-retries): add unit tests for retrieveWebhookInfoById (5) (#1942) * test(webhook-retries): add unit tests for webhook service (6) (#1943) * test(webhook-retries): add unit tests for message, producer, consumer (7) (#1988) * test: add tests for WebhookQueueMessage * test: add tests for webhook consumer * test: add tests for WebhookProducer * test: add tests for important utils * feat: increase jitter with increasing base interval * fix: calculate next attempt from time of initial attempt * feat(webhook-retries): enable toggling retries on frontend (4) (#1941) * test: make Date.now consistent in producer tests
- Loading branch information
1 parent
9a62939
commit ad4cf26
Showing
39 changed files
with
2,096 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# Wait for all Localstack services to be ready | ||
while [[ "$(curl -s -f http://localhost:4566/health | jq '[.services[] == "running"] | all')" != "true" ]]; do | ||
sleep 5 | ||
done | ||
|
||
# Create SQS queue for webhooks | ||
# First create dead-letter queue and get its ARN so it can be specified as the DLQ | ||
# for the main queue. Note that the DLQ name is not an environment variable | ||
# in the application, as this is configured from the AWS console in production. | ||
DLQ_NAME=local-webhooks-sqs-deadLetter | ||
DLQ_URL=$(awslocal sqs create-queue --queue-name $DLQ_NAME | jq --raw-output '.QueueUrl') | ||
DLQ_ARN=$(awslocal sqs get-queue-attributes --queue-url $DLQ_URL --attribute-names QueueArn | jq --raw-output '.Attributes.QueueArn') | ||
|
||
# Show output for all main resources created | ||
set -x | ||
|
||
# For main queue, extract queue name, which is the part of the queue URL after the final "/" | ||
awslocal sqs create-queue --queue-name ${WEBHOOK_SQS_URL##*/} --attributes '{ | ||
"ReceiveMessageWaitTimeSeconds": "20", | ||
"RedrivePolicy": "{\"deadLetterTargetArn\":\"'"$DLQ_ARN"'\",\"maxReceiveCount\":1}" | ||
}' | ||
|
||
# Create S3 buckets | ||
awslocal s3 mb s3://$IMAGE_S3_BUCKET | ||
awslocal s3 mb s3://$LOGO_S3_BUCKET | ||
awslocal s3 mb s3://$ATTACHMENT_S3_BUCKET | ||
|
||
set +x |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const TIMEZONE = 'Asia/Singapore' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.