{"id":20231814,"url":"https://github.com/philipmw/ada-messaging","last_synced_at":"2026-05-31T01:31:08.921Z","repository":{"id":89532800,"uuid":"42370927","full_name":"philipmw/ada-messaging","owner":"philipmw","description":"A program demonstrating AWS SQS for Ada Developers Academy","archived":false,"fork":false,"pushed_at":"2015-09-16T16:11:30.000Z","size":137,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T00:30:58.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/philipmw.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}},"created_at":"2015-09-12T19:54:53.000Z","updated_at":"2015-09-16T20:10:26.000Z","dependencies_parsed_at":"2023-03-03T20:42:11.829Z","dependency_job_id":null,"html_url":"https://github.com/philipmw/ada-messaging","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmw%2Fada-messaging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmw%2Fada-messaging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmw%2Fada-messaging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipmw%2Fada-messaging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philipmw","download_url":"https://codeload.github.com/philipmw/ada-messaging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241678157,"owners_count":20001682,"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","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-14T07:49:26.269Z","updated_at":"2026-05-31T01:31:08.912Z","avatar_url":"https://github.com/philipmw.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"float:right\"\u003e\u003ca href=\"https://flattr.com/submit/auto?user_id=philip4g\u0026url=https%3A%2F%2Fgithub.com%2Fphilipmw%2Fada-messaging\" target=\"_blank\"\u003e\u003cimg src=\"https://button.flattr.com/flattr-badge-large.png\" alt=\"Flattr this\" title=\"Flattr this\" border=\"0\"\u003e\u003c/a\u003e\u003c/div\u003e\n\n# SQS demo for Ada Developers Academy\n\nThis program supports two modes: *speaker* and *listener*.\n\n## Setup\n\nSet AWS environment variables:\n\n```\nexport AWS_REGION=us-west-2\nexport AWS_ACCESS_KEY_ID=\u003cget from Philip\u003e\nexport AWS_SECRET_ACCESS_KEY=\u003cget from Philip\u003e\n```\n\nInstall dependencies: `bundle`\n\n## Run as speaker\n\n```\nrake speaker\n```\n\n## Run as listener\n\n```\nrake listener\n```\n\n## Cost\n\nThe only AWS technology in use here is Simple Queue Service (SQS).\nThere are two factors to consider: the number of messages, and amount of data\nentering and leaving AWS.\n\nAssuming one message every second, 24x7, that's up to 2,678,400 messages per month.\nFurther, assume each message is 500 bytes.\n\nThe first 1M messages per month are free, then 50¢ per 1M.  For the quantity\nof messages, our cost is about 84¢.\n\nFor data transfer, we estimate about 1.34 GB.  Data transfer _in_ is free, and \n_out_ is 9¢ per gigabyte after the first gigabyte.  Thus, that's about 4¢ for\ndata transfer.\n\nIn total, we estimate we'd pay 88¢ per month for our estimated AWS usage.\n\n## Set up your own queue and users\n\nThis demo uses an existing queue and users in Philip's AWS account, but here's\nhow to set up your own.  I include two sets of instructions: the simpler case\nof just one user that can both write to and read from the queue, and the case of\ntwo users, one for reading and one for writing.\n\n### One user for reading and writing\n\n1. Log in to the AWS console and go to its SQS section.\n2. Create a new SQS queue.  Note its ARN.\n3. Copy your new queue's ARN into the `QUEUE_ARN` constant of `queue.rb`.\n4. Go to the IAM section of AWS console.\n5. Create a new policy; use the Policy Generator.\n    1. Effect: Allow\n    2. AWS Service: AWS SQS\n    3. Actions: All Actions (*)\n    4. ARN: the ARN of your new queue (from step 2)\n6. Create a new user; write down its access and secret keys, and set them in your environment variables.\n7. Attach the policy from step 5 to the new user.\n\n### A user for writing, a user for reading\n\n1. Log in to the AWS console and go to its SQS section.\n2. Create a new SQS queue.  Note its ARN.\n3. Copy your new queue's ARN into the `QUEUE_ARN` constant of `queue.rb`.\n4. Go to the IAM section of AWS console.\n5. Create a new policy for _reader_ user; use the Policy Generator.\n    1. Effect: Allow\n    2. AWS Service: AWS SQS\n    3. Actions: `ChangeMessageVisibility`, `ChangeMessageVisibilityBatch`, `DeleteMessage`,\n        `DeleteMessageBatch`, `ReceiveMessage`.\n    4. ARN: the ARN of your new queue (from step 2)\n6. Create a new policy for _writer_ user; use the Policy Generator.\n    1. Effect: Allow\n    2. AWS Service: AWS SQS\n    3. Actions: `PurgeQueue`, `SendMessage`, `SendMessageBatch`.\n    4. ARN: the ARN of your new queue (from step 2)\n6. Create a new _reader_ and _writer_ users; write down their access and secret keys.\n7. To each user of your two new users, attach the correct policy.\n\nNow you can run this program in _speaker_ or _listener_ mode after setting the\nenvironment variables to the correct user's access and secret keys.\n\n## Contributing\n\n[![Build Status](https://travis-ci.org/philipmw/ada-messaging.svg)](https://travis-ci.org/philipmw/ada-messaging)\n\nPlease feel free to contribute fixes and enhancements.\n\nRun unit tests with `rake spec`.\n\n## References\n\n* [AWS SDK for Ruby](https://aws.amazon.com/sdk-for-ruby/)\n* [AWS SDK for Ruby - SQS client API](http://docs.aws.amazon.com/sdkforruby/api/Aws/SQS.html)\n* [AWS SQS Pricing](https://aws.amazon.com/sqs/pricing/)\n* [AWS Simple Monthly Calculator](http://calculator.s3.amazonaws.com/index.html)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipmw%2Fada-messaging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilipmw%2Fada-messaging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipmw%2Fada-messaging/lists"}