TopicNameExtractor — Dynamic Routing of Output Records

TopicNameExtractor is the abstraction of topic name extractors that Kafka Streams developers use for dynamic routing of records by extracting the name of the topic to publish a record to.

TopicNameExtractor can be specified using the high-level or the low-level Topology.addSink operators.
Table 1. TopicNameExtractor Contract
Method Description


String extract(
  final K key,
  final V value,
  final RecordContext recordContext)

Extracts the name of the topic to publish a record to

Used exclusively when SinkNode is requested to process a record

StaticTopicNameExtractor is an internal implementation of the TopicNameExtractor Contract in Kafka Streams.
Read up on the feature in KIP-303: Add Dynamic Routing in Streams Sink.

results matching ""

    No results matching ""