2. What’s new?

2.1 What’s new in 2.1 Since 2.0

2.1.1 Kafka Client Version

This version requires the 1.0.0 kafka-clients or higher.

[Note]Note

The 1.1.x client is supported, with version 2.1.5, but you will need to override dependencies as described in Appendix A, Override Dependencies to use the 1.1.x/2.0.x kafka-clients with an Embedded Broker. The 1.1.x client will be supported natively in version 2.2.

2.1.2 JSON Improvements

The StringJsonMessageConverter and JsonSerializer now add type information in Headers, allowing the converter and JsonDeserializer to create specific types on reception, based on the message itself rather than a fixed configured type. See Section 4.1.5, “Serialization/Deserialization and Message Conversion” for more information.

2.1.3 Container Stopping Error Handlers

Container Error handlers are now provided for both record and batch listeners that treat any exceptions thrown by the listener as fatal; they stop the container. See Section 4.1.8, “Handling Exceptions” for more information.

2.1.4 Pausing/Resuming Containers

The listener containers now have pause() and resume() methods (since version 2.1.3). See Section 4.1.4, “Pausing/Resuming Listener Containers” for more information.

2.1.5 Stateful Retry

Starting with version 2.1.3, stateful retry can be configured; see the section called “Stateful Retry” for more information.

2.1.6 Client ID

Starting with version 2.1.1, it is now possible to set the client.id prefix on @KafkaListener. Previously, to customize the client id, you would need a separate consumer factory (and container factory) per listener. The prefix is suffixed with -n to provide unique client ids when using concurrency.

2.1.7 Logging Offset Commits

By default, logging of topic offset commits is performed with the DEBUG logging level. Starting with version 2.1.2, there is a new property in ContainerProperties called commitLogLevel which allows you to specify the log level for these messages. See the section called “KafkaMessageListenerContainer” for more information.

2.1.8 Default @KafkaHandler

Starting with version 2.1.3, one of the @KafkaHandler s on a class-level @KafkaListener can be designated as the default. See the section called “@KafkaListener on a Class” for more information.

2.1.9 ReplyingKafkaTemplate

Starting with version 2.1.3, a subclass of KafkaTemplate is provided to support request/reply semantics. See the section called “ReplyingKafkaTemplate” for more information.

2.1.10 ChainedKafkaTransactionManager

Version 2.1.3 introduced the ChainedKafkaTransactionManager see the section called “ChainedKafkaTransactionManager” for more information.

2.1.11 After rollback processing

Starting with version 2.1.6, a new AfterRollbackProcessor strategy is provided - see the section called “After Rollback Processor” for more information.

2.1.12 Transactional Id

When a transaction is started by the listener container, the transactional.id is now the transactionIdPrefix appended with <group.id>.<topic>.<partition>. This is to allow proper fencing of zombies as described here.

2.1.13 Migration Guide from 2.0

2.0 to 2.1 Migration.