becketqin commented on a change in pull request #7262: [FLINK-10478] Kafka 
Producer wrongly formats % for transaction ID
URL: https://github.com/apache/flink/pull/7262#discussion_r302832450
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/internal/TransactionalIdsGenerator.java
 ##########
 @@ -55,7 +55,7 @@ public TransactionalIdsGenerator(
                checkArgument(safeScaleDownFactor > 0);
                checkArgument(subtaskIndex >= 0);
 
-               this.prefix = checkNotNull(prefix);
+               this.prefix = checkNotNull(prefix).replaceAll("%", "%%");
 
 Review comment:
   Would it be better to keep the original String as is, but only replace `%` 
with `%%` when `String.format()` is called? This will ensure all the variables 
have a consistent view of a String.

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


With regards,
Apache Git Services

Reply via email to