GithubHelp home page GithubHelp logo

pradeepcheers / aws-kinesis-zombies Goto Github PK

View Code? Open in Web Editor NEW

This project forked from capside/aws-kinesis-zombies

0.0 2.0 0.0 63 KB

Código del webinar sobre programación y kinesis.

License: GNU General Public License v3.0

Shell 19.39% Batchfile 13.75% Java 61.43% HTML 5.43%

aws-kinesis-zombies's Introduction

Kinesis with Zombies

We are Capside

  • And we are kinda nice

Drink and learn

Introduction

Devel credentials

  • Generate new credentials with at least access to Kinesis, Cloudwatch and DynamoDB
  • Set the permissions as environment variables, in Windows:
SET AWS_ACCESS_KEY_ID=<your access key>
SET AWS_SECRET_ACCESS_KEY=<your secret key>
SET AWS_DEFAULT_REGION=us-west-2
  • On Mac/Linux:
export AWS_ACCESS_KEY_ID=<your access key>
export AWS_SECRET_ACCESS_KEY=<your secret key>
export AWS_DEFAULT_REGION=us-west-2

Using the cli to create and check the Kinesis stream

aws dynamodb delete-table --table-name Zombies
aws kinesis delete-stream --stream-name zombies
aws kinesis create-stream --stream-name zombies --shard-count 2
aws kinesis describe-stream --stream-name zombies
aws kinesis describe-stream --stream-name zombies --query StreamDescription.StreamStatus
aws kinesis get-shard-iterator --stream-name zombies --shard-id shardId-000000000000 --shard-iterator-type TRIM_HORIZON --query ShardIterator
aws kinesis get-records --shard-iterator "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Creating the stream using the console

  • Be sure to remember the region you are going to use
  • Set 'zombies' as the stream name and ask for a capacity of 2 shards

Getting the source code

  • If you are going to use an IDE download and install Lombok
  • Visit the github project
  • Either download it as a zip or clone the repo with git clone https://github.com/capside/aws-kinesis-zombies
  • Build both projects with your IDE or using Maven
cd aws-kinesis-zombies/ZombieProducer
mvn package
cd ZombieConsumer
mvn package 

Getting the binaries

  • Use them if you don't want to take a look at the code
  • Download them from the project releases

Gotchas

  • Remember to delete both the Kinesis Stream and the DynamoDB table
  • Kinesis is key sensitive with the name of the streams
  • The KCL uses DynamoDB to keep track of the stream. Create alerts to monitor the corresponding table.

Running the producer and the consumer

The next scripts will start the projects allowing you to attach an external debugger to the session. Run them on the folders in which the jar binaries are located. DISCLAIMER: for optimum performance, of course, run at least the consumer on EC2 instances.

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 ^
     -jar ZombieProducer-0.0.2-SNAPSHOT.jar ^
     --drone=5555 --stream=zombies --region=us-west-2 --latitude=51.509865 --longitude=-0.118092
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1045 ^
     -jar ZombieConsumer-0.0.2-SNAPSHOT.jar ^
     --stream=zombies --region=us-west-2

After launching both programs you can access the visualization using http://localhost:8080. And for additional fun:

  • London
java -jar ZombieProducer-0.0.2-SNAPSHOT.jar ^
     --drone=3333 --stream=zombies --region=us-west-2 --latitude=51.509865 --longitude=-0.118092
  • Manchester
java -jar ZombieProducer-0.0.2-SNAPSHOT.jar ^
     --drone=3333 --stream=zombies --region=us-west-2 --latitude=53.4808 --longitude=-2.2426
  • Edinburgh
java -jar ZombieProducer-0.0.2-SNAPSHOT.jar ^
     --drone=3333 --stream=zombies --region=us-west-2 --latitude=55.9533 --longitude=-3.1883
  • Madrid
java -jar ZombieProducer-0.0.2-SNAPSHOT.jar ^
     --drone=3333 --stream=zombies --region=us-west-2 --latitude=40.415363 --longitude=-3.707398
  • Barcelona
java -jar ZombieProducer-0.0.2-SNAPSHOT.jar ^
     --drone=3333 --stream=zombies --region=us-west-2 --latitude=41.3902 --longitude=2.15400

aws-kinesis-zombies's People

Contributors

alexjmoore avatar ciberado avatar

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.