lucliu1108 commented on code in PR #22639:
URL: https://github.com/apache/kafka/pull/22639#discussion_r3462108015


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java:
##########
@@ -692,13 +693,24 @@ private static StreamsRebalanceData 
initStreamsRebalanceData(final UUID processI
 
         final Map<String, StreamsRebalanceData.Subtopology> subtopologies = 
initBrokerTopology(config, internalTopologyBuilder);
 
-        return new StreamsRebalanceData(
+        final StreamsRebalanceData streamsRebalanceData = new 
StreamsRebalanceData(
             processId,
             endpoint,
             rackId,
             subtopologies,
             config.getClientTags()
         );
+
+        if 
(config.getBoolean(StreamsConfig.TOPOLOGY_DESCRIPTION_PUSH_ENABLED_CONFIG)) {
+            final TopologyDescription description = 
internalTopologyBuilder.describe();
+            if (description != null) {
+                streamsRebalanceData.setWireTopologyDescription(
+                    TopologyDescriptionConverter.toWire(description)
+                );
+            }
+        }

Review Comment:
   Changed. There is a unit test that would fail with null description (which 
shouldn't happen in practice), i adjusted the mock precondition of 
`testStreamsRebalanceDataWithStreamsProtocol` to make description empty instead 
of null to avoid the failure.



##########
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java:
##########
@@ -1342,7 +1347,13 @@ public class StreamsConfig extends AbstractConfig {
                     Type.LONG,
                     null,
                     Importance.LOW,
-                    WINDOW_SIZE_MS_DOC);
+                    WINDOW_SIZE_MS_DOC)
+            .define(TOPOLOGY_DESCRIPTION_PUSH_ENABLED_CONFIG,
+                    Type.BOOLEAN,
+                    true,
+                    Importance.MEDIUM,
+                    TOPOLOGY_DESCRIPTION_PUSH_ENABLED_DOC
+                );

Review Comment:
   Fixed



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to