This repository contains the sample code the book "Kafka: The Definitive Guide (Gwen Shapira, Neha Narkhede, and Todd Palino)" and the personal study note of Apache Kafka.
Package | Description |
---|---|
com.kafkadefinitiveguide.producer.send |
The basic examples of producers for sending messages in different styles: fire-and-forget, synchronous and asynchronous. |
com.kafkadefinitiveguide.producer.serializer.customserializer |
The example of writing a custom serializer for a POJO class. |
com.kafkadefinitiveguide.producer.serializer.avroserializer |
The example of sending messages by using Avro serializer. |
com.kafkadefinitiveguide.producer.partitioner.custompartitioner |
The example of writing a custom partitioner. |
Package | Description |
---|---|
com.kafkadefinitiveguide.consumer.receive |
The basic example of a consumer. |
com.kafkadefinitiveguide.consumer.commit |
The examples of different offset commit strategies: synchronous, asynchronous, combination of synchronous and asynchronous, specifying offset. |
com.kafkadefinitiveguide.consumer.rebalancelisteners |
The examples of using rebalance listeners. |
com.kafkadefinitiveguide.consumer.exitpollloop |
The example of how to exit a poll loop safely. |
com.kafkadefinitiveguide.consumer.deserializer.customdeserializer |
The example of writing a custom deserializer for a POJO class. |
com.kafkadefinitiveguide.consumer.deserializer.avrodeserializer |
The example of receiving messages by using Avro deserializer. |
com.kafkadefinitiveguide.consumer.assignpartitions |
The example of assigning a consumer to partitions instead of letting the consumer subscribing a topic. |