{"id":18366546,"url":"https://github.com/kcalixto/poc-serverless-alerts","last_synced_at":"2025-07-25T08:09:41.750Z","repository":{"id":155665373,"uuid":"627110628","full_name":"kcalixto/poc-serverless-alerts","owner":"kcalixto","description":"⚙️ poc-serverless-alerts","archived":false,"fork":false,"pushed_at":"2023-10-23T14:08:13.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T17:36:29.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kcalixto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-12T20:02:36.000Z","updated_at":"2023-11-17T06:53:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"0bbd69ab-d3bc-4c1b-8bd8-5ab430ef8056","html_url":"https://github.com/kcalixto/poc-serverless-alerts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kcalixto/poc-serverless-alerts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcalixto%2Fpoc-serverless-alerts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcalixto%2Fpoc-serverless-alerts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcalixto%2Fpoc-serverless-alerts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcalixto%2Fpoc-serverless-alerts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kcalixto","download_url":"https://codeload.github.com/kcalixto/poc-serverless-alerts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcalixto%2Fpoc-serverless-alerts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266978000,"owners_count":24015486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T23:18:05.867Z","updated_at":"2025-07-25T08:09:41.727Z","avatar_url":"https://github.com/kcalixto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\ntitle: 'Serverless Framework Node SQS Producer-Consumer on AWS'\ndescription: 'This template demonstrates how to develop and deploy a simple SQS-based producer-consumer service running on AWS Lambda using the traditional Serverless Framework.'\nlayout: Doc\nframework: v3\nplatform: AWS\nlanguage: nodeJS\npriority: 1\nauthorLink: 'https://github.com/serverless'\nauthorName: 'Serverless, inc.'\nauthorAvatar: 'https://avatars1.githubusercontent.com/u/13742415?s=200\u0026v=4'\n--\u003e\n\n# Serverless Framework Node SQS Producer-Consumer on AWS\n\nThis template demonstrates how to develop and deploy a simple SQS-based producer-consumer service running on AWS Lambda using the Serverless Framework and the [Lift](https://github.com/getlift/lift) plugin. It allows to accept messages, for which computation might be time or resource intensive, and offload their processing to an asynchronous background process for a faster and more resilient system.\n\n## Anatomy of the template\n\nThis template defines one function `producer` and one Lift construct - `jobs`. The producer function is triggered by `http` event type, accepts JSON payloads and sends it to a SQS queue for asynchronous processing. The SQS queue is created by the `jobs` queue construct of the Lift plugin. The queue is set up with a \"dead-letter queue\" (to receive failed messages) and a `worker` Lambda function that processes the SQS messages.\n\nTo learn more:\n\n- about `http` event configuration options, refer to [http event docs](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/)\n- about the `queue` construct, refer to [the `queue` documentation in Lift](https://github.com/getlift/lift/blob/master/docs/queue.md)\n- about the Lift plugin in general, refer to [the Lift project](https://github.com/getlift/lift)\n- about SQS processing with AWS Lambda, please refer to the official [AWS documentation](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html)\n\n### Deployment\n\nInstall dependencies with:\n\n```\nnpm install\n```\n\nThen deploy:\n\n```\nserverless deploy\n```\n\nAfter running deploy, you should see output similar to:\n\n```bash\nDeploying aws-node-sqs-worker-project to stage dev (us-east-1)\n\n✔ Service deployed to stack aws-node-sqs-worker-project-dev (175s)\n\nendpoint: POST - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/produce\nfunctions:\n  producer: aws-node-sqs-worker-project-dev-producer (167 kB)\n  jobsWorker: aws-node-sqs-worker-project-dev-jobsWorker (167 kB)\njobs: https://sqs.us-east-1.amazonaws.com/000000000000/aws-node-sqs-worker-project-dev-jobs\n```\n\n\n_Note_: In current form, after deployment, your API is public and can be invoked by anyone. For production deployments, you might want to configure an authorizer. For details on how to do that, refer to [http event docs](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/).\n\n### Invocation\n\nAfter successful deployment, you can now call the created API endpoint with `POST` request to invoke `producer` function:\n\n```bash\ncurl --request POST 'https://xxxxxx.execute-api.us-east-1.amazonaws.com/produce' --header 'Content-Type: application/json' --data-raw '{\"name\": \"John\"}'\n```\n\nIn response, you should see output similar to:\n\n```bash\n{\"message\": \"Message accepted!\"}\n```\n# poc-serverless-alerts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcalixto%2Fpoc-serverless-alerts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcalixto%2Fpoc-serverless-alerts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcalixto%2Fpoc-serverless-alerts/lists"}