Spring for Apache Kafka


Gary Russell , Artem Bilan , Biju Kunjummen


Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.

Table of Contents

1. Preface
2. What’s new?
2.1. What’s new in 1.3 Since 1.2
2.1.1. Support for Transactions
2.1.2. Support for Headers
2.1.3. Creating Topics
2.1.4. Support for Kafka timestamps
2.1.5. @KafkaListener Changes
2.1.6. @EmbeddedKafka Annotation
2.1.7. After rollback processing
2.1.8. Kerberos Configuration
2.1.9. Transactional Id
3. Introduction
3.1. Quick Tour for the Impatient
3.1.1. Introduction
Very, Very Quick
With Java Configuration
Even Quicker, with Spring Boot
4. Reference
4.1. Using Spring for Apache Kafka
4.1.1. Configuring Topics
4.1.2. Sending Messages
4.1.3. Receiving Messages
Message Listeners
Message Listener Containers
@KafkaListener Annotation
Container Thread Naming
@KafkaListener on a Class
@KafkaListener Lifecycle Management
Filtering Messages
Retrying Deliveries
Detecting Idle and Non-Responsive Consumers
Topic/Partition Initial Offset
Seeking to a Specific Offset
4.1.4. Serialization/Deserialization and Message Conversion
4.1.5. Message Headers
4.1.6. Log Compaction
Handling Exceptions
After Rollback Processor
4.1.7. Kerberos
4.2. Kafka Streams Support
4.2.1. Introduction
4.2.2. Basics
4.2.3. Spring Management
4.2.4. JSON Serdes
4.2.5. Configuration
4.2.6. Kafka Streams Example
4.3. Testing Applications
4.3.1. Introduction
4.3.2. JUnit
4.3.3. @EmbeddedKafka Annotation
4.3.4. Hamcrest Matchers
4.3.5. AssertJ Conditions
4.3.6. Example
5. Spring Integration
5.1. Spring Integration for Apache Kafka
5.1.1. Introduction
5.1.2. Outbound Channel Adapter
5.1.3. Message Driven Channel Adapter
5.1.4. Message Conversion
5.1.5. What’s New in Spring Integration for Apache Kafka
6. Other Resources
I. Appendices
A. Override Dependencies to use the 1.0.x kafka-clients
B. Change History
B.1. Changes between 1.1 and 1.2
B.2. Changes between 1.0 and 1.1
B.2.1. Kafka Client
B.2.2. Batch Listeners
B.2.3. Null Payloads
B.2.4. Initial Offset
B.2.5. Seek