Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Status

Current state"Under Discussion"Accepted

Discussion thread: TODO [VOTE] KIP-243: Make ProducerConfig and ConsumerConfig constructors public (no DISCUSS thread)

JIRA: KAFKA-6382

Released: 1.1.0

...

Constructors of ProducerConfig and ConsumerConfig are not public at the moment. This makes it hard to access default values for configurations. For Kafka Streams, we need access to those default value sometime and are forces to hardcode them via "copy and pastpaste". Making constructors public allows programmatic access without the danger to forget updating Streams code in case a producer or consumer default value changes. (Note, AdminConfig constructor is already public.)

...

Code Block
languagejava
linenumberstrue
// old API
ProducerConfig(Map<?, ?> props);
ConsumerConfig(Map<?, ?> props);
 
// new API
public ProducerConfig(Map<?, ?>Properties props);
public ProducerConfig(Map<String, Object> props);
public ConsumerConfig(Properties props);
public ConsumerConfig(Map<?Map<String, ?>Object> props);

Proposed Changes

We suggest to make both constructors public.

...