Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications for successful or failed checkin #10

Open
aaron-pham opened this issue Feb 13, 2022 · 2 comments
Open

Notifications for successful or failed checkin #10

aaron-pham opened this issue Feb 13, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@aaron-pham
Copy link
Contributor

Are you interested in adding text or email notifications using Amazon SNS?

I have a few friends using this checkin service with my frontend, and this is a highly requested feature. I may start working on this soon and will create a PR if interested!

@swtools0
Copy link
Contributor

swtools0 commented Feb 13, 2022

I think this is a great idea. Here's what I suggest:

  1. Checkin succeeded notification: Create a new SNS topic to which the HandleScheduledCheckin function will publish messages upon successful checkin.
  2. Checkin failed notification: Create an SQS DLQ processor lambda function which simply fires off an SNS "checkin failed" notification to a new checkin failed topic. This queue doesn't exist yet, but I'd really like to start triggering HandleScheduledCheckin from an SQS queue. Then, on any type of failure of the HandleScheduledCheckin function, we simply throw an error, the message goes to the DLQ, and the new queue processor lambda function is responsible for the message from there. In the future, we can even consider allowing HandleScheduledCheckin to retry a couple of times before the message goes to the DLQ.

In the meantime, I'll set up the aforementioned queue and DLQ

@swtools0
Copy link
Contributor

swtools0 commented Feb 13, 2022

#13 changes the flow to

ScheduleCheckin function -> trigger-scheduled-checkin-* rule -> SqsScheduledCheckinReadyQueue queue -> HandleScheduledCheckin function

When an error is thrown by HandleScheduledCheckin, the SQS message which triggered the invocation goes to SqsScheduledCheckinReadyDlq. So, to enable failure notifications, create a lambda queue consumer of SqsScheduledCheckinReadyDlq which fires off a notification to a new checkin failed SNS topic.

@swtools0 swtools0 added the enhancement New feature or request label Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants