Kafka Streams is a client library for building mission-critical or real-time applications, where the input and/or the output data is stored in Apache Kafka clusters. We can use Kafka Streams to build a minimalistic rule engine. We can implement a simple Java project with Maven. We can assume the following standard Maven project structure:
<project home> + src\main\java\<java package>\RuleEngineDemo.java + pom.xml
To build our project we have to accomplish the following steps:
- We have to define the file pom.xml in the root directory of the project. Then, we can add the following dependencies:
...<dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-streams</artifactId> <version>1.1.0</version> ...