Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Old Kafka written in Scala and new Kafka written in Java?

Tags:

apache-kafka

Is Kafka written in Scala in old versions? And only Java is used in newer versions? (Old code written in Scala is not used anymore?) If yes, why the change?

Or are Scala and Java still used? If so, why does Kafka use both?

(I'm not asking if I can write producer or consumer in Scala or Java. I know Kafka clients can be written with many languages.)

like image 652
Jin Lee Avatar asked Oct 25 '19 06:10

Jin Lee


1 Answers

The core module and Kafka Streams Scala wrapper are currently still in Scala

Clients (as of ~0.9), Kafka Connect and main Streams API are in Java

why does Kafka use both?

Typically because Scala has nicer functional APIs and object typing semantics that are more dificult to work with in (prior) Java versions.

You can review all the code here - https://github.com/apache/kafka

like image 81
OneCricketeer Avatar answered Oct 21 '22 09:10

OneCricketeer