TopologyDescription — Meta Representation of Topology

TopologyDescription is the abstraction of meta representations (topology descriptions) that Kafka Streams developers use to know (describe) the global stores and subtopologies of a topology.

Note
InternalTopologyBuilder.TopologyDescription is the only available implementation of the TopologyDescription Contract in Kafka Streams.

TopologyDescription is available using Topology.describe method.

// Scala API for Kafka Streams
import org.apache.kafka.streams.scala._
import ImplicitConversions._
import Serdes._

val builder = new StreamsBuilder
builder
  .stream[String, String]("records")
  .groupByKey
  .count
  .toStream
  .to("counts")
val topology = builder.build

val meta = topology.describe
scala> :type meta
org.apache.kafka.streams.TopologyDescription

scala> println(meta.globalStores)
[]

scala> println(meta.subtopologies.size)
1
Table 1. TopologyDescription Contract
Method Description

globalStores

Set<GlobalStore> globalStores()

The global stores of a topology

subtopologies

Set<Subtopology> subtopologies()

The subtopologies of a topology

results matching ""

    No results matching ""