{"id":18904415,"url":"https://github.com/alexalvess/event-message-broker","last_synced_at":"2026-02-28T09:33:31.226Z","repository":{"id":216173553,"uuid":"740643958","full_name":"alexalvess/event-message-broker","owner":"alexalvess","description":"How can we work with AWS SNS (Simple Notification Service), SQS (Simple Queue Service), andAWS EventBridge as a Message Broker using NodeJS in a EDA (Event-Driven Architecture)","archived":false,"fork":false,"pushed_at":"2024-07-08T19:04:41.000Z","size":439,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T05:50:31.360Z","etag":null,"topics":["event-bridge-scheduler","event-driven","eventbus","message-broker","message-bus","message-queue","sns-topic","sqs-queue"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/event-broadcast","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexalvess.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-08T19:09:28.000Z","updated_at":"2024-11-29T07:45:03.000Z","dependencies_parsed_at":"2024-06-19T21:26:36.047Z","dependency_job_id":"644cc43c-a88c-4cf9-876e-ec98aba3cc1d","html_url":"https://github.com/alexalvess/event-message-broker","commit_stats":null,"previous_names":["alexalvess/aws-message-bus-package","alexalvess/event-broadcast","alexalvess/event-message-broker"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/alexalvess/event-message-broker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexalvess%2Fevent-message-broker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexalvess%2Fevent-message-broker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexalvess%2Fevent-message-broker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexalvess%2Fevent-message-broker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexalvess","download_url":"https://codeload.github.com/alexalvess/event-message-broker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexalvess%2Fevent-message-broker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29929350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":["event-bridge-scheduler","event-driven","eventbus","message-broker","message-bus","message-queue","sns-topic","sqs-queue"],"created_at":"2024-11-08T09:08:21.145Z","updated_at":"2026-02-28T09:33:31.202Z","avatar_url":"https://github.com/alexalvess.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message Bus SDK for AWS Resources\n\n[![NPM version](https://img.shields.io/npm/v/aws-message-bus-package.svg)](https://www.npmjs.com/package/aws-message-bus-package)\n\n## Table of Contents\n* [Getting Started](#getting-Started)\n* [API](#api)\n\n## Getting Started\n\n**1. Install**\n\n```shell\nnpm install aws-message-bus-package\n```\n\n**2. Config File**\n\nYou need to create a config.json file in your root/src project and input some AWS informations, like bellow:\n\n```json\n{\n    \"host\": \"localhost\",\n    \"port\": 4566,\n    \"region\": \"eu-west-2\",\n    \"account\": \"000000000000\",\n    \"snsArn\": \"arn:aws:sns\",\n    \"sqsArn\": \"arn:aws:sqs\",\n    \"awsHost\": \"localhost.localstack.cloud\",\n    \"tags\": [\n        { \"Key\": \"team\", \"Value\": \"your-team-name\" },\n        { \"Key\": \"appName\", \"Value\": \"your-app-name\" }\n    ],\n    \"testMode\": false\n}\n```\n\n**3. Sample Usage**\n\n```javascript\nconst { Infrastructure } = require('aws-message-bus-package');\n\nasync () =\u003e await Infrastructure.createQueue('your-queue-name');\nasync () =\u003e await Infrastructure.createTopic('your-topic-name');\nasync () =\u003e await Infrastructure.bindTopic('your-topic-name', 'your-queue-name');\n```\n\n## API\n\n### `Infrastructure.createQueue('queue-name')`\nCreate a new SQS queue\n\n### `Infrastructure.bindTopic('topic-name', 'queue-name')`\n* Create a new SNS topic, if not exists\n* Subscribe a SNS topic in a SQS queue\n\n### `Service.publishMessage('topic-name', {CONTENT})`\nSend a message to SNS topic to do broadcast\n* Content: any kind of type/object, this will be transformed into a JSON format\n\n### `Service.sendMessage('queue-name', {CONTENT}, {PARAMS})`\nSend a message to SQS queue direct\n\n* Content: any kind of type/object, this will be transformed into a JSON format\n* Params: [SQS.Types.SendMessageRequest](https://github.com/aws/aws-sdk-js/blob/7bcd9ab0d0b623ac99730a051a9758068910e9b3/clients/sqs.d.ts#L751)\n    * **You don't need to inform:**\n        * MessageBody\n        * MessageAttributes\n        * QueueUrl\n\n### `Service.scheduleMessage('topic-name', {CONTENT}, [SCHEDULED_DATE])`\nSend a message to EventBridge informing the SNS topic with the destination. This message will be consumed when it arrives on the scheduled date.\n\n* Content: any kind of type/object, this will be transformed into a JSON format\n\n### `Service.handleConsumerMessage('queue-name', {RESILIENCE_PARAMS})`\nHandle a consumer to consume queue messages\n\n* Resilience Params:\n    * maxRetryCount: max number of attempts until send to DLQ\n    * delaySeconds: the time that will wait between attempts","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexalvess%2Fevent-message-broker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexalvess%2Fevent-message-broker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexalvess%2Fevent-message-broker/lists"}