Giter Club home page Giter Club logo

aws-step-functions-business-rules-orchestration's Introduction

AWS Step Functions Business rules orchestration

Orchestration is the coordination and management of multiple components and their pieces to carry out certain tasks in a certain order. In this project, we are more interested in looking at the transient orchestration model. i.e., once started, it will finish immediately. This project uses Drools as a business rules engine and, for orchestration, uses AWS Step Functions to execute a sequence of tasks . These tasks are typical in most cases for any application: auditing the incoming request, invoking the business rule engine  and auditing the outgoing response. This project can be taken and enhanced to add or change tasks to suit your requirements. For instance, you can add incoming request validation performed against a schema or branch the request into smaller chunks of requests and merge the responses into one.

Getting Started

You will need an AWS account to use this solution. Sign up for an account here. The solution artifacts are included in this GitHub repository for reference.ness-rules-orchestration

Contents

  • Audit/
    • app.py: Lambda function that audits the incoming request and outgoing response into Amazon DynamoDB
  • ExecuteRuleset/
    • app.py: Lambda function that execute the ruleset deployed as part of drools springboot
  • drools-spring-boot/
    • src
      • main
        • docker: Docker file
        • java: Java code for restcontroller, Value object classes, code for rule server interaction
        • resources: Rules written using Drools Rule Language
    • statemachine/
      • businessrules_orchestration.asl.json: Amazon States Language JSON-based, structured language used to define state machine, collection of states.
    • template.yaml: AWS SAM template for building serverless applications for this project

Pre-requisite : The following should be installed and configured

  1. OpenJDK 17
  2. docker version 20.10.12
  3. maven 3.8.4
  4. python 3.9
  5. verify the installations a. java --version b. docker --version c. mvn --version d. docker-machine env e. python --verion

Deploy the business rules springboot application:

  1. git clone the repository

  2. Build the sprint boot application and docker image ( pre-requisite docker should be installed and started ) cd drools-spring-boot mvn clean package

  3. Tag the image as latest docker tag drools-rule-app:0.0.1-SNAPSHOT drools-rule-app:latest

  4. Create the ECR private repository which will host our docker image aws ecr create-repository --repository-name drools_private_repo --image-tag-mutability MUTABLE --image-scanning-configuration scanOnPush=false

  5. Push the docker image to ECR repository and tag the same aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ##########.dkr.ecr.us-east-1.amazonaws.com docker tag drools-rule-app:latest ##########.dkr.ecr.us-east-1.amazonaws.com/drools_private_repo:latest
    docker push ##########.dkr.ecr.us-east-1.amazonaws.com/drools_private_repo:latest

Deploy rest of the application components:

cd ..
sam build
sam deploy --guided

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-step-functions-business-rules-orchestration's People

Contributors

amazon-auto avatar kishd avatar vpannir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aws-step-functions-business-rules-orchestration's Issues

Sample doesn't work on Linux

The maven plugin in use requires a "Dockerfile" file but this project has a lowercase 'd' in the "dockerfile" it has checked in. Lowercase 'd' works on a case-insensitive filesystem like Mac, but won't work on a filesystem like Linux. (Or related environments like, Amazon Linux, Cloud 9, etc)

Getting connection refused when attempting to do a mvn docker:build

One of the maven plugins (spotify) is not working properly:
Failed to execute goal com.spotify:docker-maven-plugin:1.2.2:build (default-cli) on project drools-rule-app: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Connection refused

This error is returned when running 'mvn docker:build'

The Docker daemon is running on local mac.

Please advise.

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.