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.

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

extract

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

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

results matching ""

    No results matching ""