LiteRule4j is a lightweight rule engine written in Java, built on Akka Actor.
It is designed for IoT message processing, rule chains, and event-driven workflows.
- Built on Akka Typed / Actor Model, supports async & concurrency
- Supports Rule Chains: multiple
RuleNodeexecuted in sequence or parallel - Flexible Connections (Metadata) between nodes
- Fault tolerance with SupervisorStrategy
- Easy to integrate and extend
| Module / Package | Description |
|---|---|
actor |
Core Akka actors (AppActor, RuleChainActor, RuleNodeActor) |
actor.lifecycle |
Message definitions (RuleChinaInitMessage, RuleEngineMessage, etc.) |
api.metadata |
Rule chain data model (RuleChinaDefinition, Node, Connection, Metadata) |
api |
Context support (RuleNodeCtx, ActorSystemContext) |
-
Clone the repo
git clone https://github.com/ccwxl/LiteRule4j.git cd LiteRule4j -
Build
mvn clean package
-
Import into your project
-
Define a RuleChain and initialize actors
RuleMessage message = RuleMessage.builder() .ruleChainId("chain_has_sub_chain_node") .msgType("rule_chain_init") .putData("index", i) .build(); controller.exec(message);
- Router (RoundRobin, PoolRouter) for parallelism
- SupervisorStrategy for fault recovery
- Dispatcher, mailbox configs (TODO)
- Cluster (TODO)
- IoT device message processing
- Alerting and monitoring rules
- Dynamic rule chain execution
See LICENSE file.