Integrating Kafka with non-JVM languages.
Instruction: Discuss the challenges and considerations when integrating Kafka with applications written in non-JVM languages.
Updated
Official answer
Non-JVM applications can speak Kafka's wire protocol through a suitable client library. Select a maintained implementation and verify the specific broker/client compatibility matrix and required capabilities. Client and broker version numbers need not be identical, and a language binding may not expose every feature supported by its underlying native library.
Check TLS/SASL support, idempotence and transactions, consumer-group protocols, rebalance callbacks, error classifications, metrics and shutdown behavior. The Java API's threading/polling contract must not be blindly copied to Python, Go or JavaScript APIs. Some clients require polling to serve delivery callbacks; event-loop and native-thread interactions need testing.
Define exact key/value bytes and schema framing across languages. JSON representations, integer range, decimal handling, timestamps, null values and tombstones can differ. For keyed ordering, test that all producers serialize the key and choose partitions consistently; the same displayed string does not prove identical bytes or partitioning behavior.
Treat enqueue success separately from broker acknowledgement. Handle delivery failures, bounded buffering and backpressure; on shutdown, drain or report outstanding work within a deadline. Commit input progress only after the intended work completes and test replay/idempotency.
Run cross-language fixture records and failure tests for reconnects, authorization rejection, rebalance, malformed payloads and process exit. Monitor queue sizes, delivery errors and completed-work lag. Feature compatibility and workload measurements are stronger evidence than a claim that all clients perform alike.