From 7e5ffd3403c953e8fc80dfa89b6ca5601f3e64a2 Mon Sep 17 00:00:00 2001 From: Linsiyuan9 <154567180+Linsiyuan9@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:06:32 +0800 Subject: [PATCH] KAFKA-17583 Improve the ConfigCommand documentation to show how to set `key=[val1,val2]` (#17243) Reviewers: Andrew Schofield , Chia-Ping Tsai --- core/src/main/scala/kafka/admin/ConfigCommand.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/kafka/admin/ConfigCommand.scala b/core/src/main/scala/kafka/admin/ConfigCommand.scala index 8e9989427487a..97c727826a95d 100644 --- a/core/src/main/scala/kafka/admin/ConfigCommand.scala +++ b/core/src/main/scala/kafka/admin/ConfigCommand.scala @@ -299,7 +299,7 @@ object ConfigCommand extends Logging { val configsToBeAdded = opts.options.valueOf(opts.addConfig) .split("," + pattern) .map(_.split("""\s*=\s*""" + pattern, -1)) - require(configsToBeAdded.forall(config => config.length == 2), "Invalid entity config: all configs to be added must be in the format \"key=val\".") + require(configsToBeAdded.forall(config => config.length == 2), "Invalid entity config: all configs to be added must be in the format \"key=val\" or \"key=[val1,val2]\" to group values which contain commas.") //Create properties, parsing square brackets from values if necessary configsToBeAdded.foreach(pair => props.setProperty(pair(0).trim, pair(1).replaceAll("\\[?\\]?", "").trim)) }