Kafka Streams as a Rule Engine

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:

  1. 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> ...

Get Hands-On Industrial Internet of Things now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.