adikou commented on code in PR #22242:
URL: https://github.com/apache/kafka/pull/22242#discussion_r3210455758


##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/PlaintextConsumerCallbackTest.java:
##########
@@ -218,7 +219,8 @@ private void 
testOnPartitionsAssignedCalledWithExpectedPartitions(
     private void subscribeAndExpectOnPartitionsAssigned(Consumer<byte[], 
byte[]> consumer, List<String> topics, Collection<TopicPartition> 
expectedPartitionsInCallback) throws InterruptedException {
         var partitionsAssigned = new AtomicBoolean(false);
         AtomicReference<Collection<TopicPartition>> partitionsFromCallback = 
new AtomicReference<>();
-        consumer.subscribe(topics, new ConsumerRebalanceListener() {
+        consumer.subscribe(topics);
+        consumer.setConsumerRebalanceListener(new ConsumerRebalanceListener() {

Review Comment:
   Thanks, I'll go over the diff to swap the calls.
   But, is there a concern since the KafkaConsumer is explicitly called out to 
be from single threads and we `acquireAndEnsureOpen` to check same threaded 
access in each call post subscription? 



-- 
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