Overview
Kafka 4.0, released in March 2025, is the first major release that runs entirely without Apache ZooKeeper. It supports only KRaft mode; ZooKeeper mode has been removed. A broker can be upgraded to 4.0 only if the cluster already runs in KRaft mode with software and metadata versions of at least 3.3.x, and a cluster still on ZooKeeper has to be migrated first. 3.9 is the last release line that supports ZooKeeper mode. Four other changes decide whether the upgrade goes smoothly. Brokers, Connect and the command-line tools now need Java 17, while clients and Kafka Streams need Java 11. Old protocol API versions are removed for the first time (KIP-896), so Java clients and brokers must both be on 2.1 or later before you upgrade. Message formats v0 and v1, MirrorMaker 1 and many deprecated client APIs are gone. And because 4.0 changes the metadata format, cluster metadata cannot be downgraded afterwards.
Analogy
Key configuration
# After the rolling restart, verify, then finalize
bin/kafka-features.sh --bootstrap-server localhost:9092 upgrade --release-version 4.0
# Defaults that changed in 4.0
linger.ms: 0 -> 5
num.recovery.threads.per.data.dir: 1 -> 2
message.timestamp.after.max.ms: Long.MAX_VALUE -> 1 hour
# Removed
log.message.format.version, message.format.version
DefaultPartitioner, UniformStickyPartitioner
consumer poll(long) (use poll(Duration))
Admin.alterConfigs (use incrementalAlterConfigs)Production tip
Check yourself
Which of these must be true before you upgrade a cluster's brokers to Kafka 4.0?
Sources
- Kafka 4.0.0 release announcement (opens in a new tab)
- Upgrading to 4.0 (Apache Kafka documentation) (opens in a new tab)
- Kafka 3.9.0 release announcement (opens in a new tab)
Checked against Kafka 4.3 documentation on Oct 2026. Draft: not yet reviewed by a Kafka specialist. Releases move on, so confirm against the current documentation before you act on a number.