Versions Compared

Key

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

Table of Contents

This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.


Status

Current state: Under DiscussionAccepted

Discussion thread: here [TBA]

JIRA: here [TBA]

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Describe the problems you are trying to solve.

Public Interfaces

Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.

A public interface is any change to the following:

  • Binary log format

  • The network protocol and api behavior

  • Any class in the public packages under clientsConfiguration, especially client configuration

    • org/apache/kafka/common/serialization

    • org/apache/kafka/common

    • org/apache/kafka/common/errors

    • org/apache/kafka/clients/producer

    • org/apache/kafka/clients/consumer (eventually, once stable)

  • Monitoring

  • Command line tools and arguments

  • Anything else that will likely break existing users in some way when they upgrade

Proposed Changes

Motivation

Currently there is a way to pass a KafkaClientSupplier  in KafkaStreams  constructor. This KIP proposes to add a public config in StreamsConfig  to pass the class through config and use reflection to create 

a new KafkaClientSupplier  object. The major motivation is to allow existing KafkaStreams applications to upgrade without application code changes. Note that if existing KafkaStreams  applications want to 

use a customized KafkaClientSupplier , they may still need to add required dependencies.

Public Interfaces

We will add a public field in StreamsConfig  called default.client.supplier to configure the KafkaClientSupplier  we use in KafkaStreams. The default value of the config will the classname

of DefaultKafkaClientSupplier .

We will also add a new public method in StreamsConfig  called getKafkaClientSupplier . It will return KafkaClientSupplier  based on the config.

Proposed Changes

In KafkaStreams  constructor, we will read the value of default.client.supplier from StreamsConfig . We will use reflection to create an object of given class and throw

an exception if the class type isn't  KafkaClientSupplier . If user provides both the config and supply KafkaClientSupplier  in KafkaStreams  constructor, the config will be ignored and supplied

KafkaClientSupplier  will be used.Describe the new thing you want to do in appropriate detail. This may be fairly extensive and have large subsections of its own. Or it may be a few sentences. Use judgement based on the scope of the change.

Compatibility, Deprecation, and Migration Plan

  • What impact (if any) will there be on existing users?
  • If we are changing behavior how will we phase out the older behavior?
  • If we need special migration tools, describe them here.
  • When will we remove the existing behavior?

Test Plan

Describe in few sentences how the KIP will be tested. We are mostly interested in system tests (since unit-tests are specific to implementation details). How will we know that the implementation works as expected? How will we know nothing broke?

Rejected Alternatives

There will be no compatibility, deprecation and migration issues.

Test Plan

Unit test can capture the changes in this KIP. We can test happy path where object can be created successfully and exception case where class couldn't be found or type is wrong.

Rejected Alternatives

An alternative is that we don't need this change and user can use KafkaStreams  constructor to supply any KafkaClientSupplier  since it's a public constructor.


The benefits of this alternative are:

  1. Don't need this KIP and code changes in this KIP (smile)
  2. Users don't need to upgrade AK version to use new KafkaClientSupplier 
  3. Users using same config for different KafkaStreams  can have a different KafkaClientSupplier 


The downsides of this alternative are:

  1. Users need to change every KafkaStreams  constructor call in order to use a new KafkaClientSupplier .

So to cater for users who don't want to update their source code, we are proposing to add this config option as wellIf there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.