Understanding tables and Streams together
Before we start discussing tables and Streams, let's understand the following simple code of a word count program written in Java using a Kafka Stream API, and then we will look into the concepts of KStream
and KTable
. We have been discussing the concepts of Kafka Stream; in this section, we will discuss KStream
, KTable
, and their internals.
Maven dependency
The Kafka Stream application can be run from anywhere. You just need to add library dependency and start developing your program. We are using Maven to build our application. Add the following dependency into your project:
<dependency> <groupId>org.apache.Kafka</groupId> <artifactId>Kafka-Streams</artifactId> <version>0.10.0.0</version> </dependency>
Kafka Stream word count
The following code is a simple word count program built using a Stream API. We will go through the important APIs used in this program, and will talk about their uses...