Skip to content

pedroxs/drools-jar-consumer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drools with dynamic rules

Tests run:

Run with docker

From the root folder execute the following:

mvn clean package

docker run -d --name sample-drools -v $(pwd)/target:/opt/sample -v $(pwd)/src/main/resources/rules/:/opt/rules tifayuki/java:8 java -jar /opt/sample/drools-jar-consumer-0.0.1-SNAPSHOT.jar

docker run -d --volumes-from=rules --link=mongo:mongo -e spring.data.mongodb.uri=mongodb://mongo/test --name drools-consumer pedroxs/drools-consumer:0.1.0

Discover the container IP:

container_ip=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' sample-drools`

Use curl to verify:

❯ curl "http://${container_ip}:8080/version" -w "\n"
shipping-rules-0.1.0.jar
❯ curl "http://${container_ip}:8080/message" -w "\n"
{"text":"Hello"}
❯ curl "http://${container_ip}:8080/rule?version=2" -w "\n"
Rule version 2 applied!
❯ curl "http://${container_ip}:8080/message" -w "\n"
{"text":"Hello new version!"}

About

Drools and dynamic rules with jar packaging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages