Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-323

KafkaCluster#withKafkaConfiguration() does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 0.6.2
    • 0.5.1
    • test-infrastructure
    • None

      I was using the test-jar for embedding a Kafka cluster in my own application (within tests) and found this (quite annoying) bug with KafkaCluster.

      Problem : you can pass whatever property within withKafkaConfiguration(), they won't appear in the Kafka config.

      My diagnosis :
      When using "withKafkaConfiguration", the KafkaCluster creates "new Properties(kafkaConfig)", which means, an empty Properties object, with default values pointing to KafkaConfig.

      This makes absolute sense, but if you pay attention here the KafkaConfig constructor which is called is "KafkaConfig(Map)". So the properties are used by Kafka as a Map. Kafka then iterates over the map keys (see org.apache.kafka.common.config.AbstractConfig), and by doing so, ignores the "defaults" which were set by withKafkaConfiguration.

      Hope this helps.

            Unassigned Unassigned
            aesteve_jira Arnaud Esteve (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: