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[One of "Under Discussion", "Accepted", "Rejected"]

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: here [Change the link from KAFKA-1 to your own ticket]

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

Motivation

Kafka command-line tools commonly operate against a broker running on the local machine. Requiring --bootstrap-server localhost:9092 for every invocation adds noise to quick-start, local development, and troubleshooting workflows.

Default local endpoints are useful for command-line clients:

  • The mysql client uses localhost:3306 when no host or port is specified.

  • zkCli.sh historically used localhost:2181 when no server was specified.

  • kafka-streams-application-reset.sh already uses localhost:9092 when --bootstrap-server is absent.

The Streams application reset tool implements its default by initializing its bootstrap-server value to localhost:9092, then replacing it only when the user supplies --bootstrap-server. This KIP applies the same convenience to the other client tools while retaining explicit connection options for all non-local use cases.

Public Interfaces

The broker endpoint option becomes optional for the included tools. Explicit connection options continue to be supported.

Priority

Connection source

Behavior

1

--bootstrap-server

Use the supplied broker endpoint.

2

--bootstrap-controller

Use the supplied controller endpoint, where the tool supports it and --bootstrap-server is absent.

3

Existing connection properties

Use the configured endpoint, such as bootstrap.servers.

4

No endpoint supplied

Use localhost:9092.

When both --bootstrap-server and --bootstrap-controller are supplied, --bootstrap-server takes precedence


Proposed Changes

Apply the priority above to the included tools. This KIP does not default --bootstrap-controller: tools that support both endpoint types use localhost:9092 only when neither endpoint is specified.

Included tools

Group

Tools

Default behavior

Example

Broker or controller endpoint

kafka-acls.sh, kafka-configs.shkafka-cluster.sh, kafka-features.shkafka-metadata-quorum.shkafka-reassign-partitions.sh

Default to localhost:9092 only when neither --bootstrap-server nor --bootstrap-controller is supplied. Preserve existing controller-operation restrictions.

bin/kafka-cluster.sh cluster-id

--bootstrap-server only

kafka-client-metrics.shkafka-console-consumer.shkafka-console-producer.shkafka-console-share-consumer.shkafka-consumer-groups.shkafka-consumer-perf-test.shkafka-delegation-tokens.shkafka-delete-records.shkafka-e2e-latency.shkafka-get-offsets.shkafka-groups.shkafka-leader-election.shkafka-log-dirs.shkafka-share-consumer-perf-test.shkafka-share-groups.shkafka-streams-groups.shkafka-topics.shkafka-transactions.shkafka-verifiable-consumer.shkafka-verifiable-producer.shkafka-verifiable-share-consumer.sh

Make --bootstrap-server optional and default it to localhost:9092.

bin/kafka-topics.sh --create --topic local-events

Multiple producer property sources

kafka-producer-perf-test.sh

Default only when neither its command-line nor property-based configuration supplies bootstrap.servers.

bin/kafka-producer-perf-test.sh --topic local-events --num-records 1000 --record-size 100 --throughput -1

Legacy address-list option

kafka-replica-verification.sh

Make its address-list --broker-list optional and default it to localhost:9092. This differs from the broker-ID --broker-list in kafka-reassign-partitions.sh.

bin/kafka-replica-verification.sh --topics-include local-events

Existing default

kafka-streams-application-reset.sh

No code change; it already defaults to localhost:9092.

bin/kafka-streams-application-reset.sh --application-id local-streams-app --input-topics local-events --to-earliest --dry-run

Excluded tools

The following tools do not connect to a running Kafka cluster through a client bootstrap endpoint and remain unchanged:

  • kafka-dump-log.sh

  • kafka-jmx.sh

  • kafka-metadata-shell.sh

  • kafka-server-start.sh

  • kafka-server-stop.sh

  • kafka-storage.sh

Deprecated tools are out of scope. Connect launchers, kafka-run-class.sh, and trogdor.sh are also out of scope because they obtain cluster connection settings through worker, application, or workload configuration.

Compatibility, Deprecation, and Migration Plan

  • Existing invocations continue to work unchanged.

  • Invocations without a broker endpoint attempt to connect to localhost:9092.

  • Remote clusters, TLS/SASL listeners, non-default ports, and controller endpoints continue to use explicit connection options or command configuration.

  • Quick-start documentation may omit --bootstrap-server localhost:9092 and state the local default once. Production, security, and remote-cluster examples retain explicit endpoint options.

Rejected Alternatives

  • Default --bootstrap-controller to localhost:9093 for tools that also support --bootstrap-server. This would change the normal local broker workflow and would be ambiguous for tools whose controller support applies only to selected operations. A future controller-only tool may define localhost:9093 as its own default; no such tool is in scope here.

  • Add a global environment variable or configuration file. This introduces a second connection-configuration mechanism; existing command-line options and properties files already provide portable non-local configuration.

  • No labels