[ 
https://issues.apache.org/jira/browse/KAFKA-13863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531880#comment-17531880
 ] 

Colin McCabe commented on KAFKA-13863:
--------------------------------------

We already validate that topic configurations can't be null in 
`ControllerConfigurationValidator`.

{code}
  override def validate(
    resource: ConfigResource,
    config: util.Map[String, String]
  ): Unit = {
    resource.`type`() match {
      case TOPIC =>
        validateTopicName(resource.name())
        val properties = new Properties()
        val nullTopicConfigs = new mutable.ArrayBuffer[String]()
        config.entrySet().forEach(e => {
          if (e.getValue() == null) {
            nullTopicConfigs += e.getKey()
          } else {
            properties.setProperty(e.getKey(), e.getValue())
          }
        })
        if (nullTopicConfigs.nonEmpty) {
          throw new InvalidRequestException("Null value not supported for topic 
configs : " +
            nullTopicConfigs.mkString(","))
        }
{code}

I don't mind adding extra test coverage but there should be no need to change 
`ReplicationControlManager`, as far as I can see.

> Prevent null config value when create topic in KRaft mode
> ---------------------------------------------------------
>
>                 Key: KAFKA-13863
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13863
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: dengziming
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to