[ https://issues.apache.org/jira/browse/KAFKA-6687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16530822#comment-16530822 ]
Matthias J. Sax commented on KAFKA-6687: ---------------------------------------- You have to distinguish between the DSL level and the runtime level. At runtime level, it is not possible (and also does not make sense) to read a topic twice. Atm, this restriction is reflected in the DSL. The idea is, to remove this restriction from the DSL and rewrite the topology internally. Ie, it's about syntactic sugar at DSL level. Atm, users might need to write "ugly" code to get the same result. Note, that this ticket is blocked, until we get the first version of the new topology optimizer in place. This is WIP by [~bbejeck]. Does this make sense? > Allow to read a topic multiple times > ------------------------------------ > > Key: KAFKA-6687 > URL: https://issues.apache.org/jira/browse/KAFKA-6687 > Project: Kafka > Issue Type: Improvement > Components: streams > Reporter: Matthias J. Sax > Priority: Major > > Users often want to read topic multiple times. However, this is not possible > because there is a single consumer and thus a topic can only be consumed once. > Users get an exception > {quote}Exception in thread “main” > org.apache.kafka.streams.errors.TopologyException: Invalid topology: Topic > source has already been registered by another source. > {quote} > If they use a topic name in multiple `stream()`, `table()`, `globalTable()` > calls. > However, with KAFKA-6034 in place, we could allow adding a topic multiple > times and rewrite the topology internally to only read the topic once. This > would simplify application code as users don't need to put workaround in > place to get the same behavior. -- This message was sent by Atlassian JIRA (v7.6.3#76005)