O'Reilly logo

Apache Kafka by Nishant Garg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Java consumer API

Kafka provides two types of API for Java consumers:

  • The high-level consumer API
  • The simple consumer API

Note

The high-level consumer API provides an abstraction over the low-level implementation of the consumer API, whereas the simple consumer API provides more control to the consumer by allowing it to override its default low-level implementation.

High-level consumer API

The high-level consumer API is used when only data is needed and the handling of message offsets is not required. Hence, most of the low-level details are abstracted during message consumption. The high-level consumer stores the last offset read from a specific partition in ZooKeeper. This offset is stored based on the consumer group name provided ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required