Skip to content
CAI
Software that uses CAICheck a score

zendesk/ruby-kafka

60.6

Adequate · 6 November 2026

10k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Ruby client library for Apache Kafka that facilitates message production, consumption, and cluster administration. It supports modern Kafka features including transactional messaging, consumer group coordination, and various SASL authentication mechanisms. The library provides both synchronous and asynchronous producers with compression support, alongside comprehensive tooling for testing and protocol-level interaction.

Features

Add protocol support for Kafka 0.10+ features and administrative APIs

The library now implements the Kafka protocol for a wide range of new and upgraded operations, enabling support for Kafka 0.10+ features and administrative tasks. This includes new request/response classes for transactional messaging (InitProducerID, AddPartitionsToTxn, AddOffsetsToTxn, EndTxn), consumer group coordination (JoinGroup, SyncGroup, Heartbeat, LeaveGroup, FindCoordinator), and cluster administration (CreateTopics, CreatePartitions, DeleteTopics, AlterConfigs, DescribeConfigs, DescribeGroups, ListGroups). The Fetch API is upgraded to version 4 to support RecordBatches and ReadCommitted isolation levels, and the ListOffset API is upgraded to version 2. Additionally, an ApiVersions API is added to allow clients to discover supported broker versions, and the core Encoder/Decoder classes are enhanced with varint support for efficient serialization.

lib/kafka/protocol · high confidence

Added benchmark for message encoding and decoding

A new benchmark file has been added to measure the performance of Kafka message serialization, specifically focusing on the encoding and decoding of messages with string values and keys.

benchmarks · high confidence

Introduce new asynchronous producer and refactored cluster connection architecture

The library now includes an \AsyncProducer\ that delivers messages in the background using a configurable queue with backpressure (raising \BufferOverflow\ when full) and optional automatic delivery thresholds or intervals. The underlying connection management has been refactored to use a \BrokerPool\ and \ConnectionBuilder\, centralizing broker connections and SASL authentication logic, while the \Cluster\ class now manages broker discovery and metadata refreshes. Additionally, compression support has been expanded to include Gzip, Snappy, LZ4, and Zstd codecs via a new \Compressor\ class.

lib/kafka · high confidence

New SASL authentication mechanisms: AWS MSK IAM, GSSAPI, OAuth, and SCRAM

The library now supports four additional SASL authentication mechanisms for connecting to Kafka brokers. Users can authenticate using AWS MSK IAM (including optional session tokens), GSSAPI (Kerberos) via the \gssapi\ gem, OAuth/OAuthBearer with a custom token provider, and SCRAM-SHA-256/512 with configurable mechanisms. These new classes are located in \lib/kafka/sasl/\ and integrate with the existing SASL framework, allowing users to specify the mechanism via the \sasl\_mechanism\ configuration option.

lib/kafka/sasl · high confidence

New example scripts for Kafka consumers, producers, and SSL configuration

Added a set of example scripts in the \examples/\ directory to demonstrate various usage patterns of the Kafka client library. These include \simple-consumer.rb\ and \simple-producer.rb\ for basic message consumption and production, \consumer-group.rb\ for handling consumer groups with error recovery, \firehose-consumer.rb\ and \firehose-producer.rb\ for high-throughput scenarios using multiple threads and async producers, and \ssl-producer.rb\ for demonstrating SSL/TLS configuration with client certificates. The examples also show how to load environment variables using \dotenv\ and handle graceful shutdowns.

examples · high confidence

Behavioural changes

Library deprecated and license changed to Apache 2.0

The ruby-kafka library is no longer actively developed and has been superseded by rdkafka-ruby; users are advised to migrate. Additionally, the project license has changed from MIT to Apache 2.0, and the gem name in installation instructions has been updated to ruby-kafka.

(repo-wide) · high confidence

Standardized Kafka protocol error handling with specific exception classes

The library now provides a structured hierarchy of exceptions for Kafka protocol errors, replacing generic error handling. All protocol-specific errors (such as OffsetOutOfRange, NotLeaderForPartition, and RebalanceInProgress) are now subclasses of Kafka::ProtocolError, which itself inherits from Kafka::Error. This allows users to catch specific Kafka protocol violations or handle all protocol errors collectively, improving reliability and debugging for applications interacting with Kafka brokers.

lib · high confidence

Switch development console to Pry and clean up bin scripts

The development console (bin/console) now uses Pry instead of IRB, providing an enhanced interactive Ruby experience for experimentation. Additionally, the bin/setup script has been cleaned up by removing an unused comment placeholder, and a frozen\_string\_literal pragma has been added to bin/console for better string performance.

bin · high confidence

Test coverage

Added comprehensive test suite for Kafka client components; Added functional tests for Kafka client capabilities; Added fuzz test for consumer group message delivery; Added protocol unit tests for decoder, encoder, and message formats; Added test fixtures for client certificate chain validation.

Dependencies

58 commits updating dependencies (4 manifests)

A dependency / build maintenance change in (dependencies) — 58 commits (3 fixs), 4 files.

(dependencies) · medium confidence · unverified

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 58 → 61 (+2.8)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 68 → 68 (+0.0)
  • Architecture 87 → 85 (-2.0)
  • Maturity 47 → 53 (+6.3)
  • Readiness 57 → 56 (-0.2)
  • Security 100 → 100 (+0.0)
  • Performance 80 → 80 (+0.0)

Resolved (4)

  • Inconsistent naming for potentially identical or similar operations. In Ruby, the ! suffix often implies a more dangerous or mutating operation, but here both methods likely trigger the same underlying heartbeat mechanism. Having both creates confusion about which one to use.
  • Off-boarding risk: anonymized user #1
  • Redundant methods for resolving offsets. One handles a single partition, the other handles multiple, but the naming convention is inconsistent (singular vs plural) and the distinction is subtle. Typically, a single method accepting an array or hash would be preferred, or consistent naming like resolve_offset and resolve_offsets.
  • Same inconsistency as in Consumer. Two methods with and without ! suffix for triggering a heartbeat, likely duplicating intent or causing confusion about side effects.

New (5)

  • Off-boarding risk: anonymized user #1
  • Outdated: activesupport
  • Outdated: docker-api
  • Outdated: rubocop
  • Outdated: snappy

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

zendesk/ruby-kafka was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7a6c046f4452fc7dc0c1f81113be68bff71b4b61 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.