Home > Software engineering >  Containerized drools rules engine?
Containerized drools rules engine?

Time:05-11

We have this Java codebase that has a good amount of business rules written in Drools. I have been tasked with designing and recommending and alternative cloud-based rules engine, so that other services and applications within the company can utilize it too. Here is the high level plan:

  • Perform a "Lift and shift" by decoupling the rule execution from the java code base
  • Create a containerized rules service that takes in an input via HTTP or a message queue and returns output, or perform some actions (Send notifications, queue something, etc)
  • Host it on Azure or GCP

I'm trying to create a baby POC. I need some help with some of the implementation details. For example, would creating a .NET REST endpoint and then passing in the data to the drools Java container be a feasible idea? Or would it be simpler to just create simple Java REST endpoint that uses Drools behind the scenes?

Any tips or examples of this would be highly appreciated, as I don't want to re-invent the wheel!

CodePudding user response:

Drools has a native build in REST web service that can be embedded in Java Containers (JBoss, Tomcat). This framework is the KIE Server and can be activated to host build in Drools Process/Rules.

https://docs.jboss.org/drools/release/7.69.0.Final/drools-docs/html_single/#_ch.kie.server

There are some docker images that contains default KIE Server that you can use and deploy your rules to. Ex : https://hub.docker.com/r/jboss/kie-server/

Hope this helps,

Best, Emmanuel

CodePudding user response:

Or would it be simpler to just create simple Java REST endpoint that uses Drools behind the scenes?

You might want to consider using Kogito for your DRL rules, instead of having to deploy a containerised Kie Server.

Then, to have a Docker image generated easily with Kogito-on-Quarkus, it's enough to add the Quarkus' JIB extension to your Kogito-on-Quarkus app.

  • Related