Versions Compared

Key

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

...

Public Interfaces

The producer will have a few new configurations added. Default values of -1 will use broker defaults or raise an exceptionconfiguration added.

NameDescriptionTypeDefaultValid ValuesImportance
allow.auto.create.topicsConfigures how topic auto-creation will occur. 'False' does allow auto-topic creation. 'Server-side' allows the server to create the topic if the broker's 'auto.create.topics.enable' is true. 'Client-side' creates the topic client-side. Client-side auto-creation is only supported by brokers with version greater than 0.10.1.1.Stringallow-server-side[false, allow-server-side, client-side]mediumauto.create.num.partitionsThe default number of log partitions per topic for auto-created topics. This value is only used if the broker's auto-creation configuration has been disabled and the producer's config has been enabled.int-1mediumauto.create.replication.factor


The

...

The goal is to deprecate automatic topic creation on the broker. At some point in the future, it may be useful to set the broker's auto.create.topics.enable default to false. However, for compatibility reasons, doing so is not possible at this time. Likewise, it would make sense to eventually change the default of the consumer's allow.auto.create.topics to false since it has no effect if the broker configuration is false. 

...

If server-side auto-creation is enabled with the broker's auto.create.topics.enable, the broker's defaults for partitions and replication factor will be used. When serverclient-side auto-creation is disabled, client-side auto-creation will try to use client-side configurations if set. However, if none exist, as represented by -1, enabled, broker-side defaults can will be used if the broker supports KIP 464. Client-side auto-creation is not supported for older brokers (greater than 0.10.1.1) if no client configurations are given, and even older brokers (versions before 0.10.1.1) do not support client-side auto-creation at all.

Compatibility, Deprecation, and Migration Plan

...

    • By default, 'allow-server-side' auto-creation is used. The broker's 'auto.create.topics.enable' must be configured as true.
      • Although the broker config and server-side auto-creation is deprecated, this is the default to ensure compatibility.
      • If the broker config is set to false, the topic will not be created automatically.
    • Systems that rely on auto-creation would be encouraged to set the producer config auto.create.topics.enable to 'client-side.'
      • This will effectively override the deprecated broker config, so even if it is configured to true, the server will not auto-create topics.
      • Systems with older broker versions would need to set auto.create.num.partitions and auto.create.replication.factor upon allowing 'client-side' auto-creationthat do not support KIP-464 would not be compatible with this option.
    • Systems that want to turn off auto-creation completely should set the producer config to false. This will override the broker config for this producer.
    • Systems that utilize auto-creation on the consumer will no longer be able to do so with only the producer config enabled.
      • Enabling the broker config or making further changes to the code is required.

...

  • Enabling true by default on the producer config:
    • Topic auto-creation is a feature that is not supported as it once was, so defaulting to false supports this trend towards using admin client to create topics. Auto-creation does not work on older brokers without configuration client-side anyway, so it might be more clear that configuration must be done in order to keep using this feature. 
  • Add configurations producer-side for replication factor, partitions of new topics
    • The idea is to keep this simple; configuring these values is not simple and could add to more issues for users.