close

Spring for Apache Kafka

2.9.0

The 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.

Features

  • KafkaTemplate

  • KafkaMessageListenerContainer

  • @KafkaListener

  • KafkaTransactionManager

  • spring-kafka-test jar with embedded kafka server

Scala/Jackson Incompatibility

See this appendix for information about how to resolve an important Scala incompatibility when using the embedded Kafka server with Jackson 2.11.3 or later and spring-kafka 2.5.x. This version of Jackson is included in Spring Boot 2.3.5 dependency management.

Kafka Client Compatibility

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.0.x (pre release)

6.0.x

3.2.0

3.0.x

2.9.x

5.5.x

3.2.0

2.7.x (not managed)

2.8.x

5.5.x

3.0.0

2.6.x or 2.7.x (not managed)

2.7.x

5.5.x

2.7.0 - 2.8.1

2.4.x or 2.5.x (End of Life)

2.6.x

5.3.x or 5.4.x

2.6.0 - 2.8.1

2.3.x or 2.4.x (End of Life)

2.5.x

3.3.x

2.5.1 - 2.8.1

2.3.x (End of Life)

2.4.x

3.2.x

2.4.1

2.2.x (End of Life)

2.3.x

3.2.x

2.3.1

2.2.x (End of Life)

2.2.x

3.1.x

2.0.1, 2.1.x, 2.2.x

2.1.x (End of Life)

2.1.x

3.0.x

1.0.2

2.0.x (End of Life)

1.3.x

2.3.x

0.11.0.x, 1.0.x

1.5.x (End of Life)

IMPORTANT: This matrix is client compatibility; for a complete discussion about client/broker compatibility, see the Kafka Compatibility Matrix

  • Spring Integration Kafka versions prior to 2.0 pre-dated the Spring for Apache Kafka project and therefore were not based on it.

These versions will be referenced transitively when using maven or gradle for version management.

  • Spring Boot 1.5 (EOL) users should use 1.3.x (Boot dependency management will use 1.1.x by default so this should be overridden).

  • Spring Boot 2.1 (EOL) users should use 2.2.x (Boot dependency management will use the correct version).

  • Spring Boot 2.2 (EOL) users should use 2.3.x (Boot dependency management will use the correct version, or override version to 2.4.x).

  • Spring Boot 2.3 (EOL) users should use 2.5.x (Boot dependency management will use the correct version, or override version to 2.6.x).

  • Spring Boot 2.4 (EOL) users should use 2.6.x (Boot dependency management will use the correct version, or override version to 2.7.x).

  • Spring Boot 2.5 (EOL) users should use 2.7.x (Boot dependency management will use the correct version).

  • Spring Boot 2.6 users should use 2.8.x (Boot dependency management will use the correct version).

  • Spring Boot 2.7 users should use 2.8.x (Boot dependency management will use the correct version).

To use 2.6.x with Boot 2.3.x; see Override Spring Boot Dependencies.

To use 2.7.x with Boot 2.4.x; see Override Spring Boot Dependencies.

IMPORTANT Spring Boot 2.3.5 and later (in the 2.3.x line) brings in a version of Jackson that pulls in an incompatible Scala library. See this appendix for more information, or upgrade spring-kafka and kafka-clients to 2.6.x.

Spring Initializr

Quickstart Your Project

Bootstrap your application with Spring Initializr.

Documentation

Each Spring project has its own; it explains in great details how you can use project features and what you can achieve with them.
2.9.0 CURRENT GA Reference Doc. API Doc.
3.0.0-SNAPSHOT SNAPSHOT Reference Doc. API Doc.
3.0.0-M5 PRE Reference Doc. API Doc.
2.9.1-SNAPSHOT SNAPSHOT Reference Doc. API Doc.
2.8.8 GA Reference Doc. API Doc.
2.7.14 GA Reference Doc. API Doc.
2.6.13 GA Reference Doc. API Doc.
2.5.17.RELEASE GA Reference Doc. API Doc.
Branch Initial Release End of Support End Commercial Support *
2.9.x
2022-07-25 2024-12-31 2026-12-31
2.8.x
2021-11-15 2022-11-15 2024-03-15
2.7.x
2021-04-14 2022-05-19 2023-09-19
2.6.x
2020-09-08 2021-09-08 2023-01-08
2.5.x
2020-05-13 2021-05-13 2022-09-13
2.4.x
2019-12-23 2020-12-23 2022-04-23
2.3.x
2019-10-01 2020-10-01 2022-02-01
2.2.x
2018-10-29 2019-10-29 2021-02-28

OSS support

Free security updates and bugfixes with support from the Spring community. See VMware Tanzu OSS support policy.

Commercial support

Business support from Spring experts during the OSS timeline, plus extended support after OSS End-Of-Life.
Publicly available releases for critical bugfixes and security issues when requested by customers.

Future release

Generation not yet released, timeline is subject to changes.

About commercial support (*)

This page shows the current state of project releases and does not define the commercial support policy. Please refer to the official support policy for more information.

A few examples to try out: