Giter Club home page Giter Club logo

aws-serverless-choreography-pattern-java's Introduction

CHOREOGRAPHY Pattern - AWS Serverless - Java

This is a Java implementation of the CHOREOGRAPHY Pattern using AWS Serverless services.

Description

This is a basic representation and implementation of the Choreography pattern. In Microservice architecture the application is divided in small services which are responsible for a singe business subdomain. When these services need to communicate with each other there are several ways and different communication styles. The Choreography pattern is one of them.

The SAM template contains all the information to deploy AWS resources and also the permission required by these service to communicate.

You will be able to create and delete the CloudFormation stack using AWS SAM.

This is fully functional example implemented in Java 11.

Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the AWS Pricing page for details. You are responsible for any AWS costs incurred.

Language:

This is a Maven project which uses Java 11 and AWS SDK

Framework

The framework used to deploy the infrastructure is SAM

Services used

API Gateway - AWS Lambda - DynamoDB

Deployment commands

mvn clean package

aws s3 mb s3://hifo8q34hfksdjnfpqwf

aws s3 cp target/sourceCode.zip s3://hifo8q34hfksdjnfpqwf

sam deploy --s3-bucket hifo8q34hfksdjnfpqwf --stack-name choreography-pattern --capabilities CAPABILITY_IAM

Add cinemas and movies in DynamoDB tables

aws dynamodb batch-write-item --request-items file://./dynamodb/movies.json

aws dynamodb batch-write-item --request-items file://./dynamodb/cinemas.json

TESTING

Copy the URL from the SAM Outputs: CloudFormation outputs from deployed stack

Key PaymentsEndpoint
Description API Gateway Cinema Endpoint
Value https://XXXXXXXX.execute-api.XXXXXXXXXX.amazonaws.com/prod/cinema

Add the cinemaID/movies at the end of the URL. cinemaID available: aaaa and bbbb

curl https://XXXXXXXX.execute-api.XXXXXXXX.amazonaws.com/prod/cinema/aaaa/movies -H "Accept: application/json"

curl https://XXXXXXXX.execute-api.XXXXXXXX.amazonaws.com/prod/cinema/bbbb/movies -H "Accept: application/json"

CLEAN-UP

aws cloudformation delete-stack --stack-name choreography-pattern

aws s3 rm s3://hifo8q34hfksdjnfpqwf --recursive

aws s3 rb s3://hifo8q34hfksdjnfpqwf

Requirements

Author

Razvan Minciuna https://www.linkedin.com/in/razvanminciuna/

aws-serverless-choreography-pattern-java's People

Stargazers

 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.