I am a new learner of kafka.But what make me confused is that there seems to be two packages of kafka clients.
One is kafka.javaapi.* like
import kafka.javaapi.producer.Producer;
import kafka.producer.KeyedMessage;
import kafka.producer.ProducerConfig;
the other is org.apache.kafka.*. like
import org.apache.kafka.clients.producer.KafkaProducer<K,V>
which is shown is page http://kafka.apache.org/082/javadoc/index.html?org/apache/kafka/clients/producer
I don't know what's their differences.
Before Kafka 0.8.2, kafka.javaapi.producer.Producer was the only official Java client (producer) which is implemented with Scala.
From Kafka 0.8.2, there comes a new Java producer API, org.apache.kafka.clients.producer.KafkaProducer, which is fully implemented with Java.
Kafka 0.8.2 Documentation says
We are in the process of rewritting the JVM clients for Kafka. As of 0.8.2 Kafka includes a newly rewritten Java producer. The next release will include an equivalent Java consumer. These new clients are meant to supplant the existing Scala clients, but for compatability they will co-exist for some time. These clients are available in a seperate jar with minimal dependencies, while the old Scala clients remain packaged with the server.
If you are interested in kafka.javaapi.producer.Producer, refer to 2.1 Producer API in Kafka 0.8.1 Documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With