· AI dev tools

Confluent rewrites Kafka Java client in Rust using AI, releases Rust client for Kafka 4.4.0

The necessity of maintaining feature parity across languages, despite Kafka's primary Java client, drove Confluent to undertake a massive undertaking: rewriting the Kafka Java client in Rust using…


The necessity of maintaining feature parity across languages, despite Kafka's primary Java client, drove Confluent to undertake a massive undertaking: rewriting the Kafka Java client in Rust using AI, a process that ultimately required starting over.

Confluent dedicated nearly three months to employing AI coding agents to convert Apache Kafka's existing Java client into Rust. This effort involved discarding an initial version because performance issues surfaced, problems that the automated testing procedures failed to catch. Ultimately, the team settled upon a workflow involving multiple agents, which they anticipate will allow non-Java clients to keep pace with Kafka's ongoing development.

Andrew Schofield, a principal engineer and Apache Kafka committer at Confluent, detailed this work in a technical blog post released Tuesday. The process began utilizing Anthropic's Claude Opus 4.6 and subsequently incorporated several model enhancements. Confluent has since made available its first generally available Rust client, which was translated from Apache Kafka 4.4.0, alongside a preview of a new Python client.

The engineers were able to integrate 191 upstream Kafka commits, representing several months of development, into the translated codebase in under two working days. Confluent intends to establish a continuous translation pipeline to ensure its non-Java clients stay synchronized with future Kafka releases.

Since Kafka primarily offers a Java client, Confluent Cloud manages a substantial volume of connections originating from clients written in languages other than Java. The current non-Java clients depend on librdkafka, which possesses threading and memory management characteristics different from those found in the Java implementation. Given that Kafka boasts over 100 active contributors and typically sees more than 20 Kafka Improvement Proposals per release, Confluent sought to derive its non-Java clients directly from the Java source code via AI-assisted translation, thereby preserving feature equivalence through a shared Rust foundation.

The experimental setup involved three agents: one designated as a translation agent, and two engineers who each committed about 75% of their time to the project. Within two weeks, the team achieved a functional Rust producer, although it lacked secure connections. TLS and authentication were added in the fourth week, and a basic consumer was operational by the sixth week.

After several weeks, the team abandoned the initial translation and began anew, implementing more granular instructions for the agents. The agents frequently sought consultation from the engineers regarding Kafka's underlying architecture. Within Confluent's established translation process, a Project Manager agent oversees the Actor and Critic agents. Engineers provide approval for both phase and milestone plans, offering input on architectural choices, such as how to map Java threads onto Tokio tasks. The Actor and Critic communicate using Git; the Actor commits the translated code and addresses any concerns raised by the Critic until no further issues are reported. Schofield noted that this review cycle generally requires about five iterations.

Even when the generated code successfully passed the tests derived from the translated Kafka suite, performance evaluations uncovered a sleep operation occurring during every iteration of the networking loop. Consequently, Confluent refined its translation directives, specifying the desired operational behavior rather than relying solely on the original source code or the translated test cases. Simply passing the tests proved inadequate for confirming the quality of the code produced by the agents.

While the agents were handling the translation, the engineers collaborated with Rust specialists to devise interfaces that maintained Kafka compatibility without forcing Java conventions onto the Rust developers. The team evaluated six distinct design candidates to guarantee that the Rust core could manage timeouts without negatively impacting signal handling within other language runtimes.

When Apache Kafka 4.4.0 was released, the team chose to update its existing Rust implementation rather than starting the translation process from scratch. Integrating the 191 upstream commits took less than two working days. Confluent has not yet demonstrated its capability to keep multiple client implementations synchronized as Kafka evolves, nor has it specified the amount of ongoing engineering effort required. Schofield anticipates that the continuous translation pipeline will begin handling this synchronization in the middle of 2027. The source code for this work is accessible under the Apache License 2.0.

Although Confluent is joining a wider trend of rewriting code using agents in Rust, its specific objective is to maintain the translated code across subsequent Kafka releases. Schofield commented, "Getting code quickly was only the beginning; making it useful across languages was the real engineering work."

Why it matters

This experiment demonstrates a significant trend in developer tooling: using AI agents for large-scale, cross-language codebase migration. For working developers, this signals a potential shift toward AI-assisted maintenance and feature parity across diverse client stacks.

Earlier coverage

Related coverage

Also worth reading

  1. Node 26.14.0 released, adding child_process.timedOut, fs.mkstemp, and http batch body spans
  2. next.js 16.5.0-rc.1 released, fixing image cache ages and keeping immutable assets
  3. Angular 22.3.1 released with fixes to animations, compiler, and core functionality
  4. Pro teams now use usage-based billing for Standard builds, costing $0.014 per minute
  5. Teleport Beams agent runtime provides sandboxing, identity, access, and auditing for AI agents