FrancisGodinho commented on code in PR #21161:
URL: https://github.com/apache/kafka/pull/21161#discussion_r2629863889


##########
tools/src/main/java/org/apache/kafka/tools/TransactionalMessageCopier.java:
##########
@@ -308,9 +308,11 @@ public static void runEventLoop(Namespace parsedArgs) {
 
         String consumerGroup = parsedArgs.getString("consumerGroup");
 
-        final KafkaProducer<String, String> producer = 
createProducer(parsedArgs);
+        KafkaProducer<String, String> producer = createProducer(parsedArgs);
         final KafkaConsumer<String, String> consumer = 
createConsumer(parsedArgs);
 
+        int producerNumber = 0;

Review Comment:
   this doesn't work for local variables, only class variables. get this error 
   ```
   error: variable producerNumber might not have been initialized 
parsedArgs.getAttrs().put("transactionalId", 
parsedArgs.getString("transactionalId") + producerNumber++);
   ```



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