Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreThe Spring for Apache Kafka (spring-kafka) project applies core Spring concepts to the development of Kafka-based messaging solutions. It provides a "template" as a high-level abstraction for sending messages. It also provides support for Message-driven POJOs with @KafkaListener
annotations and a "listener container". These libraries promote the use of dependency injection and declarative. In all of these cases, you will see similarities to the JMS support in the Spring Framework and RabbitMQ support in Spring AMQP.
KafkaTemplate
KafkaMessageListenerContainer
@KafkaListener
KafkaTransactionManager
Retryable Topics
spring-kafka-test
jar with embedded kafka server
Use the support tab above for information about supported versions.
Spring for Apache Kafka is based on the pure java kafka-clients
jar. The following is the compatibility matrix:
Spring for Apache Kafka Version | Spring Integration for Apache Kafka Version | kafka-clients |
Spring Boot |
---|---|---|---|
3.3.x | 6.4.x | 3.8.0 to 3.9.0 | 3.4.x |
3.2.x | 6.3.x | 3.7.0 | 3.3.x |
3.1.x | 6.2.x | 3.6.0 | 3.2.x |
3.0.x | 3.3.2 to 3.6.0 |
IMPORTANT: This matrix is client compatibility; for a complete discussion about client/broker compatibility, see the Kafka Compatibility Matrix
To override Apache Kafka client versions, see Override Spring Boot Dependencies.
Bootstrap your application with Spring Initializr.