Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-1040

ConsumerConfig and ProducerConfig do "work" in the Constructor

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: config, consumer, producer
    • Labels:
    • Environment:
      Java 1.7
      Linux Mint 14 (64bit)

      Description

      It appears that validation of configuration properties is performed in the ConsumerConfig and ProducerConfig constructors. This is generally bad practice as it couples object construction and validation. It also makes it difficult to mock these objects in unit tests.

      Ideally validation of the configuration properties should be separated from object construction and initiated by those that rely/use these config objects.

      http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/

        Attachments

          Activity

            People

            • Assignee:
              nehanarkhede Neha Narkhede
              Reporter:
              saden1 Sharmarke Aden
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: