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.
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
Audit/
app.py
: Lambda function that audits the incoming request and outgoing response into Amazon DynamoDBExecuteRuleset/
app.py
: Lambda function that execute the ruleset deployed as part of drools springbootdrools-spring-boot/
src
main
docker
: Docker file java
: Java code for restcontroller, Value object classes, code for rule server interactionresources
: 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 projectPre-requisite : The following should be installed and configured
Deploy the business rules springboot application:
git clone the repository
Build the sprint boot application and docker image ( pre-requisite docker should be installed and started ) cd drools-spring-boot mvn clean package
Tag the image as latest docker tag drools-rule-app:0.0.1-SNAPSHOT drools-rule-app:latest
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
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
This library is licensed under the MIT-0 License. See the LICENSE file.