Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Getting Started with Kafka

This guide covers Kafka installation, client setup, and basic operations to begin working with event streaming.


RequirementMinimumRecommended
JavaJDK 11 (3.x) / JDK 17 (4.0)JDK 17 or 21
Memory4 GB8+ GB
Disk10 GBSSD recommended
OSLinux, macOS, WindowsLinux for production

Kafka components have different JDK support levels. Kafka 4.0 introduced significant changes to Java version requirements.

Kafka 4.0+ (applies to 4.0, 4.1, and 4.2):

ComponentJava 11Java 17Java 21
Kafka Clients
Kafka Streams
Kafka Connect
Kafka Server

Legend: ✅ Supported | ❌ Not Supported

Java 8 and 11 Changes in Kafka 4.0

  • Java 8 support is completely removed in Kafka 4.0
  • Java 11 is no longer supported for Connect and Server components
  • Clients and Streams still support Java 11 for backward compatibility

Kafka 3.x:

ComponentJava 8Java 11Java 17
All Components

Kafka maintains bidirectional compatibility between clients and brokers within certain version ranges.

Client/Broker forward compatibility with Kafka 4.x:

Client VersionModule4.x CompatibilityNotes
0.x, 1.x, 2.0AllPre-0.10.x protocols removed in 4.0 (KIP-896)
2.1 - 2.8Client⚠️ PartialSome consumer/producer changes
2.1 - 2.8Streams⚠️ LimitedAPI changes may affect applications
2.1 - 2.8Connect⚠️ LimitedConnector compatibility varies
3.xAll✅ FullFully compatible
4.0 - 4.1All✅ FullFully compatible with 4.2 brokers

Legend: ✅ Full | ⚠️ Partial | ❌ Not Compatible

Kafka 4.0+ Protocol Changes

  • Pre-0.10.x protocol versions are fully removed in Kafka 4.0 (KIP-896)
  • The --zookeeper option in AdminClient commands has been removed; use --bootstrap-server instead
  • Clients older than 2.1 must be upgraded before connecting to Kafka 4.0+ brokers

General compatibility guarantees:

  • Clients can communicate with brokers of the same or adjacent major versions
  • Protocol versioning allows automatic feature negotiation
  • Older clients may not access features introduced in newer broker versions

KRaft clusters have specific version requirements for controllers and brokers.

Server compatibility with Kafka 4.x:

KRaft Cluster Version4.x Dynamic Voter4.x Static Voter
Before 3.2.x
3.3.x - 3.8.x
3.9.x
4.0.x - 4.3.x

Static to Dynamic Voter Migration

Upgrading a cluster from static voter to dynamic voter configuration is not supported. See KAFKA-16538 for details.

FeatureMinimum VersionNotes
KRaft (production)3.3ZooKeeper still required for some features until 3.5
KRaft (full feature parity)3.5All features available without ZooKeeper
Tiered Storage3.6Early access
Share Groups4.0KIP-932
ZooKeeper removal4.0KRaft required
Streams Rebalance Protocol4.1 (early access), 4.2 (GA)KIP-1071
Share Groups v24.2RENEW ack type (KIP-1222), acquire modes (KIP-1206)
Standardized CLI arguments4.2KIP-1147

OptionUse CaseComplexity
Local InstallationDevelopment, learningLow
DockerDevelopment, CI/CDLow
KubernetesProduction, cloud-nativeMedium

Terminal window
# Download Kafka
curl -O https://downloads.apache.org/kafka/4.3.0/kafka_2.13-4.3.0.tgz
# Extract
tar -xzf kafka_2.13-4.3.0.tgz
cd kafka_2.13-4.3.0

Kafka 3.3+ supports KRaft mode, eliminating the ZooKeeper dependency.

Terminal window
# Generate cluster ID
KAFKA_CLUSTER_ID="$(bin/kafka-storage.sh random-uuid)"
# Format storage
bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties
# Start Kafka
bin/kafka-server-start.sh config/kraft/server.properties
Terminal window
bin/kafka-topics.sh --create \
--topic quickstart-events \
--bootstrap-server localhost:9092 \
--partitions 3 \
--replication-factor 1
Terminal window
bin/kafka-console-producer.sh \
--topic quickstart-events \
--bootstrap-server localhost:9092

Type messages and press Enter to send each one. Press Ctrl+C to exit.

Terminal window
bin/kafka-console-consumer.sh \
--topic quickstart-events \
--from-beginning \
--bootstrap-server localhost:9092

Kafka provides official and community clients for multiple languages.

LanguageClientDocumentation
JavaApache Kafka ClientDriver Guide
Pythonconfluent-kafka-pythonDriver Guide
Goconfluent-kafka-goDriver Guide
Node.jskafkajsDriver Guide
.NETconfluent-kafka-dotnetDriver Guide

Client Drivers


After installation, verify the cluster is operational:

Terminal window
# Check broker status
bin/kafka-broker-api-versions.sh --bootstrap-server localhost:9092
# List topics
bin/kafka-topics.sh --list --bootstrap-server localhost:9092
# Describe cluster
bin/kafka-metadata.sh --snapshot /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log --command "describe"

PropertyDescriptionDefault
broker.idUnique broker identifierRequired
listenersNetwork listenersPLAINTEXT://:9092
log.dirsData directory/tmp/kafka-logs
num.partitionsDefault partitions for new topics1
default.replication.factorDefault replication factor1
SettingDevelopmentProduction
log.dirsSingle directoryMultiple directories on separate disks
num.partitions1-3Based on throughput requirements
default.replication.factor13
min.insync.replicas12

Configuration Reference


GoalDocumentation
Understand Kafka conceptsEvent Streaming Concepts
Build a producer applicationProducer Guide
Build a consumer applicationConsumer Guide
Set up Kafka ConnectKafka Connect Guide
Configure for productionOperations Guide