Improve Your Producers Efficiency With This Powerful Calculator
Announcements
4
min read

New Features in Apache Kafka 4.0

Apache Kafka 4.0 introduces several enhancements to improve user experience, performance, and functionality.
Yaniv Ben Hemo

Apache Kafka 4.0 introduces several enhancements to improve user experience, performance, and functionality. Here’s a brief breakdown of each new feature for those less technically minded:

Kafka Client Upgrade Path

Kafka 4.0 provides a clearer and structured way for users to upgrade their Kafka client versions. This ensures a smoother transition and reduces compatibility issues when moving to newer versions.

Enable Clients to Rebootstrap Based on Timeout or Error Code

Clients can now more efficiently reconnect to the Kafka cluster if they encounter a timeout or a specific error code. This ensures better resilience and reliability in maintaining connections.

Administration of Groups (KIP-1043)

With this update, managing user groups in Kafka becomes more systematic and user-friendly. Administrators can now efficiently oversee and control group configurations and assignments.

Disable Heartbeats Topic Replication in MirrorSourceConnector

Users can now choose not to replicate heartbeats in some configurations within the MirrorSourceConnector. This flexibility is especially useful for setups with multiple connectors operating in parallel.

Enable MM2 to Replicate Topics Ending in "Internal" Suffix

Previously, certain internal topics were excluded from replication due to their naming conventions. Now, users can replicate these topics, allowing greater freedom in managing their data.

List Registered KRaft Nodes

Kafka 4.0 introduces a feature to list all registered nodes, making it easier to manage which nodes should be unregistered. This helps prevent issues during upgrades or metadata updates.

Allow Custom Processor Wrapping

Users can now customize how data processing is handled in Kafka by wrapping processors. This enhancement makes it more flexible and tailored to specific data processing needs.

Duration Based Offset Reset Option for Consumers

Consumers now have the ability to reset their offsets based on a specified duration. This feature allows for easier management of data consumption and retrieval.

Dynamic Thread-Pool Configs for Remote Log Management

Kafka can now adjust the number of threads used for managing remote logs dynamically. This helps optimize resource utilization based on demand, improving overall performance.

Support Record Keys in KTable Foreign Join

Users can now utilize both record keys and values in foreign joins with KTables. This addition removes prior restrictions and enhances data handling capabilities.

Extend kafka-consumer-groups Tool

The kafka-consumer-groups command line tool has been upgraded to better display details about new consumer groups. This means administrators can access more information for troubleshooting and managing consumer states.

Operator Metrics for Kafka Streams

New metrics have been added to Kafka Streams for tracking the state of clients and threads. This enhancement allows better monitoring and evaluation of performance.

Fix Leaking Variables in StreamsConfig

In this update, some configuration variables that should be private are now being made so. This improves code quality and reduces potential confusion for developers.

Remove Deprecated Method KStream#through

The old method KStream#through has been removed to streamline the Kafka API. This helps keep the interface clean and up-to-date with current practices.

Improved Consumer Member Handling

New consumers will now properly handle leave group requests, ensuring a cleaner exit from groups. This reduces issues of lingering member IDs in the system.

Deprecate delete-config of TopicCommand

The delete-config command has been marked for deprecation, as it no longer functions as intended. This clean-up helps refine the Kafka command set.

Remove Leaking Getter Methods in Joined Helper Class

Certain unnecessary getter methods in a helper class have been marked for deprecation. This simplifies the API and aligns functionality with design.

Make ForeachProcessor Internal

The ForeachProcessor class is being moved to an internal package to clarify its purpose. This step helps eliminate confusion regarding its usage in public APIs.

Register Additional Metrics with Clients

New methods have been introduced to allow clients to gather more metrics. This enables better monitoring of client applications in production.

Delayed Remote List Offsets

The LIST_OFFSETS API request process has been improved to prevent queueing issues during high traffic. This enhancement leads to lower latency in message producing and consuming.

Add Generics Type Parameters to MockProcessorContext

Improvements are being made to the testing components of Kafka to allow for better type checking of forwarded records. This enhances code reliability during development.

Txn Consumer Optimization

Optimizations have been made to handle aborted transactions more efficiently, particularly when reading from non-transactional topics. This ensures smoother operation even under error conditions.

Consider Removing default. Prefix for Exception Handler Config

The redundant default. prefix in exception handler configuration may be removed to simplify the Kafka configuration experience.

Drop Support for Deprecated Configurations

Several old configurations have been dropped in this version, further simplifying Kafka's setup and maintenance processes.

Upgrade Log4j to Log4j2

Kafka now utilizes Log4j2, enhancing its logging capabilities and addressing past vulnerabilities. This upgrade ensures better security and performance in log management.

Extend Consumer#close Options

The Consumer#close method now allows developers to choose whether to leave the group upon closure, providing flexibility during application shutdowns.

Enable Warmup in Producer Performance Tests

Producers can now undergo a warm-up phase during performance testing to yield more accurate and reliable benchmarking results.

StateStore Managed Changelog Offsets

StateStores will manage their changelog offsets, which optimizes storage and retrieval processes. This change leads to enhanced performance and efficiency in handling state data.

Dead Letter Queue in Kafka Streams

A new feature allows for the implementation of a dead letter queue within Kafka Streams. This provides a mechanism for handling problematic records without disrupting the main processing flow.

Support Participation in 2PC (KIP-939)

New enhancements support participation in two-phase commits, making transactions more robust and reliable. This addition strengthens the overall consistency of operations in Kafka.

As we can see, Kafka 4.0 brings numerous advancements aimed at enhancing the efficiency, flexibility, and security of this powerful messaging platform. Each feature contributes to making Kafka easier to use and more capable of handling the demands of modern data processing.

The Fastest Way To Optimize
Your Apache Kafka Costs
Recover at least 43% of your Kafka costs
and save over 20 hours of Ops time weekly.
Start free now
Free
$0
/ Savings report
Growth (Most Popular)
$10
/ TB in / Optimized Cluster / Month
  • Starts at 50TB
  • Annual plans only
Enterprise
Custom
  • Private link
  • SSO
  • Annual plans only
* Superstream does not ingest your data — we just use this metric to size your cluster and our value to it.
* Do you purchase through AWS Marketplace? You might be eligible for a discount when subscribing via AWS MP.
Your Very Own AI Team

Save Time, Save Money, and Start Today

Start free
Built and Trusted by Data Engineers worldwide