# JAVA: Kafka Topology Explained

In 
Published 2022-12-03

This tutorial explains to you what a Kafka Topology is.

Topology is an acyclic graph of stream processing nodes that represents the stream processing logic of a Kafka Streams application. The Topology is the definition of the data flows and processing logic of a stream application.

You can take a look at the following picture to understand better what a Kafka Topology is (Note: the picture was taken from here).

In this graph, the nodes are the processors, where the data is modified, transformed, etc. The lines are the streams of data.

As you can see, there are 2 types of processors:

  • the source processor: which does not have any upstream processors. This processor consumes data from one or more topics and produces an input stream to its topologies.
  • the sink processor: which does not have downstream processors. The work of this processor is to send the received data from its upstream processors to the specified topic.

A good understanding of Topology concept you can have if you see how a Topology is defined in Java :

Now, take a look at the picture below to see how you use a Topology in Java.