You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "chia7712 (via GitHub)" <gi...@apache.org> on 2026/09/28 17:05:02 UTC

Re: [PR] KAFKA-8416: Clarify two-step requirement for enabling Streams topology optimizations [kafka]

chia7712 commented on code in PR #21556:
URL: https://github.com/apache/kafka/pull/21556#discussion_r4124931303


##########
streams/src/main/java/org/apache/kafka/streams/StreamsBuilder.java:
##########
@@ -577,16 +577,28 @@ public synchronized <KIn, VIn> StreamsBuilder addGlobalStore(final StoreBuilder<
     /**
      * Returns the {@link Topology} that represents the specified processing logic.
      * Note that using this method means no optimizations are performed.
+     * To enable topology optimizations, use {@link #build(Properties)} instead and pass
+     * a {@link Properties} object with {@code topology.optimization} set to
+     * {@link StreamsConfig#OPTIMIZE}.
      *
      * @return the {@link Topology} that represents the specified processing logic
      */
     public synchronized Topology build() {
         return build(null);
     }
-    
+
     /**
      * Returns the {@link Topology} that represents the specified processing logic and accepts
      * a {@link Properties} instance used to indicate whether to optimize topology or not.
+     * <p>
+     * To enable topology optimizations, two steps are required:
+     * <ol>
+     *   <li>Set {@code topology.optimization} to {@link StreamsConfig#OPTIMIZE} in the
+     *       provided {@link Properties}.</li>
+     *   <li>Pass that same {@link Properties} object to this method.</li>
+     * </ol>
+     * If {@code topology.optimization} is not set to {@link StreamsConfig#OPTIMIZE} in

Review Comment:
   @mjsax Do you know why we didn't put `topology.optimization` in `TopologyConfig`, so that it can be passed through `StreamsBuilder(TopologyConfig)` like the other build-time configs?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org