Coder Social home page Coder Social logo

aws-sqs-test-widgets's Introduction

AWS SQS Test Widgets

This is a proof of concept which consists of

  • A producer which is tasked with submitting new requests that create widgets.

  • A consumer which takes the new request and POSTs it to a widget maker web app.

  • A widget maker web app which takes the POST request, validates the request and creates the widget.

The consumer will make use of SQS's visibility timeout feature and the ApproximateReceiveCount attribute to manage invalid requests or resend a request if the widget maker web app is down.

Setup

Build the virtualenv.

make

Create the SQS queues WidgetRequestQueue & WidgetResponseQueue. The example below uses the ap-southeast-2 region.

Run

Run the widget maker.

$ venv/bin/python widget_maker.py

Run the consumer.

$ venv/bin/python widget_consumer.py --region=ap-southeast-2

Generate a new widget request using a randomly generated widget id.

$ venv/bin/python widget_producer.py --region=ap-southeast-2

Generate a new widget request with a specific valid widget id.

$ venv/bin/python widget_producer.py --region=ap-southeast-2 \
    --widget-id=31f37378-54f4-11e5-ad75-3c970e65f731

Generate a new widget request with an invalid widget-id.

$ venv/bin/python widget_producer.py --region=ap-southeast-2 \
    --widget-id=this_is_not_a_valid_widget_id

To see the use of visibility timeout and the ApproximateReceiveCount attribute in action, stop widget_maker.py and submit a new request.

aws-sqs-test-widgets's People

Watchers

 avatar  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.