Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6686

Allow reading topic as KStream and GlobalKTable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • streams
    • None

    Description

      Users often want to read topic multiple times, eg, as a stream and a table. For KSteam/KTable this is possible by reading the data as a KTable, disable caching on the KTable, and get a stream via toStream(). This pattern does not work for KStream/GlobalKTable though.

      However, there is no need to raise an exception

      Exception in thread “main” org.apache.kafka.streams.errors.TopologyException: Invalid topology: Topic source has already been registered by another source.

      for this case, because the GlobalKTable is consumer by a different consumer (in contrast to KStream/KTable case for which KStream and KTable use a shared consumer). This fix should also allow to add a topic to a Topology twice; ie, one as regular and once as global-store topic.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mjsax Matthias J. Sax
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: