You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/07/12 05:28:01 UTC

[GitHub] [flink] becketqin commented on a change in pull request #7262: [FLINK-10478] Kafka Producer wrongly formats % for transaction ID

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:
users@infra.apache.org


With regards,
Apache Git Services