2. What’s new?

2.1. What’s New in 2.9 Since 2.8

This section covers the changes made from version 2.8 to version 2.9. For changes in earlier version, see Change History.spring-doc.cn

2.1.1. Kafka Client Version

This version requires the 3.2.0 kafka-clientsspring-doc.cn

2.1.2. Error Handler Changes

The DefaultErrorHandler can now be configured to pause the container for one poll and use the remaining results from the previous poll, instead of seeking to the offsets of the remaining records. See DefaultErrorHandler for more information.spring-doc.cn

The DefaultErrorHandler now has a BackOffHandler property. See Back Off Handlers for more information.spring-doc.cn

2.1.3. Listener Container Changes

interceptBeforeTx now works with all transaction managers (previously it was only applied when a KafkaAwareTransactionManager was used). See [interceptBeforeTx].spring-doc.cn

A new container property pauseImmediate is provided which allows the container to pause the consumer after the current record is processed, instead of after all the records from the previous poll have been processed. See [pauseImmediate].spring-doc.cn

Events related to consumer authentication and authorizationspring-doc.cn

2.1.4. Header Mapper Changes

You can now configure which inbound headers should be mapped. Also available in version 2.8.8 or later. See Message Headers for more information.spring-doc.cn

2.1.5. KafkaTemplate Changes

In 3.0, the futures returned by this class will be CompletableFuture s instead of ListenableFuture s. See Using KafkaTemplate for assistance in transitioning when using this release.spring-doc.cn

2.1.6. ReplyingKafkaTemplate Changes

The template now provides a method to wait for assignment on the reply container, to avoid a race when sending a request before the reply container is initialized. Also available in version 2.8.8 or later. See Using ReplyingKafkaTemplate.spring-doc.cn

In 3.0, the futures returned by this class will be CompletableFuture s instead of ListenableFuture s. See Using ReplyingKafkaTemplate and Request/Reply with Message<?> s for assistance in transitioning when using this release.spring-doc.cn

2.2. JsonDeserializer (Since 2.9.13)

When a deserialization exception occurs, the SerializationException message no longer contains the data with the form Can’t deserialize data [[123, 34, 98, 97, 122, …​; an array of numerical values for each data byte is not useful and can be verbose for large data. When used with an ErrorHandlingDeserializer, the DeserializationException sent to the error handler contains the data property which contains the raw data that could not be deserialized. When not used with an ErrorHandlingDeserializer, the KafkaConsumer will continually emit exceptions for the same record showing the topic/partition/offset and the cause thrown by Jackson.spring-doc.cn