Coder Social home page Coder Social logo

accumulator's Introduction

Go Accumulator Server

This Go application integrates AWS SNS (Simple Notification Service) and SQS (Simple Queue Service). It allows users to input numbers via the console, which are then published to an SNS topic. This topic forwards the messages to an SQS queue. The server polls messages from the queue, accumulates their values, and prints the running total.

Prerequisites

Before running this application, ensure you have:

  • An AWS account with access to SNS and SQS services.
  • AWS CLI configured with the necessary permissions to interact with SNS and SQS.
  • Go installed on your system.

Setup

  1. AWS Configuration: Make sure your AWS CLI is configured with credentials that have permission to publish to SNS topics and read from SQS queues. You can configure the AWS CLI by running aws configure.

  2. Create SNS Topic and SQS Queue: Use the AWS documentation to create an SNS topic and an SQS queue. Then, subscribe to the SQS queue to the SNS topic.

  3. Install Dependencies: If your application has external dependencies, install them using Go's package manager by running go mod tidy.

Running the Application

Pass three command-line arguments when running the application:

  • -q: The name of the SQS queue.
  • -t: The name of the SNS topic.
  • -a: The ARN of the SNS topic.

image

Example Command

go run main.go -q YourQueueName -t YourTopicName -a YourTopicARN


accumulator's People

Contributors

muathejamil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.