ableegoldman commented on a change in pull request #10878: URL: https://github.com/apache/kafka/pull/10878#discussion_r651411365
########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerProtocol.java ########## @@ -70,16 +71,24 @@ public static ByteBuffer serializeSubscription(final Subscription subscription, version = checkSubscriptionVersion(version); ConsumerProtocolSubscription data = new ConsumerProtocolSubscription(); - data.setTopics(subscription.topics()); + + List<String> topics = new ArrayList<>(subscription.topics()); + topics.sort(null); Review comment: ```suggestion Collections.sort(topics); ``` ########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerProtocol.java ########## @@ -17,6 +17,7 @@ package org.apache.kafka.clients.consumer.internals; import java.nio.BufferUnderflowException; +import java.util.Comparator; Review comment: nit: move these below the `o.a.k` imports -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org