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

 ##########
 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:
   @becketqin sorry for lately reply, do you mean we should keep _this.prefix = 
checkNotNull(prefix);_ unchanged. but user use String.format to replace % with 
%% of the prefix before calling _TransactionalIdsGenerator_?

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