2. What’s new?

2.1. What’s New in 2.8 Since 2.7

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

2.1.1. Kafka Client Version

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

When using transactions, kafka-clients 3.0.0 and later no longer support EOSMode.V2 (aka BETA) (and automatic fallback to V1 - aka ALPHA) with brokers earlier than 2.5; you must therefore override the default EOSMode (V2) with V1 if your brokers are older (or upgrade your brokers).

See Exactly Once Semantics and KIP-447 for more information.spring-doc.cn

2.1.2. Package Changes

Classes and interfaces related to type mapping have been moved from …​support.converter to …​support.mapping.spring-doc.cn

2.1.3. Out of Order Manual Commits

The listener container can now be configured to accept manual offset commits out of order (usually asynchronously). The container will defer the commit until the missing offset is acknowledged. See Manually Committing Offsets for more information.spring-doc.cn

2.1.4. @KafkaListener Changes

It is now possible to specify whether the listener method is a batch listener on the method itself. This allows the same container factory to be used for both record and batch listeners.spring-doc.cn

See Batch Listeners for more information.spring-doc.cn

Batch listeners can now handle conversion exceptions.spring-doc.cn

RecordFilterStrategy, when used with batch listeners, can now filter the entire batch in one call. See the note at the end of Batch Listeners for more information.spring-doc.cn

The @KafkaListener annotation now has the filter attribute, to override the container factory’s RecordFilterStrategy for just this listener.spring-doc.cn

The @KafkaListener annotation now has the info attribute; this is used to populate the new listener container property listenerInfo. This is then used to populate a KafkaHeaders.LISTENER_INFO header in each record which can be used in RecordInterceptor, RecordFilterStrategy, or the listener itself. See Listener Info Header and Abstract Listener Container Properties for more information.spring-doc.cn

2.1.5. KafkaTemplate Changes

You can now receive a single record, given the topic, partition and offset. See Using KafkaTemplate to Receive for more information.spring-doc.cn

2.1.6. CommonErrorHandler Added

The legacy GenericErrorHandler and its sub-interface hierarchies for record an batch listeners have been replaced by a new single interface CommonErrorHandler with implementations corresponding to most legacy implementations of GenericErrorHandler. See Container Error Handlers and Migrating Custom Legacy Error Handler Implementations to CommonErrorHandler for more information.spring-doc.cn

2.1.7. Listener Container Changes

The interceptBeforeTx container property is now true by default.spring-doc.cn

The authorizationExceptionRetryInterval property has been renamed to authExceptionRetryInterval and now applies to AuthenticationException s in addition to AuthorizationException s previously. Both exceptions are considered fatal and the container will stop by default, unless this property is set.spring-doc.cn

2.1.8. Serializer/Deserializer Changes

The DelegatingByTopicSerializer and DelegatingByTopicDeserializer are now provided. See Delegating Serializer and Deserializer for more information.spring-doc.cn

2.1.9. DeadLetterPublishingRecover Changes

The property stripPreviousExceptionHeaders is now true by default.spring-doc.cn

There are now several techniques to customize which headers are added to the output record.spring-doc.cn

2.1.10. Retryable Topics Changes

Now you can use the same factory for retryable and non-retryable topics. See Specifying a ListenerContainerFactory for more information.spring-doc.cn

There’s now a manageable global list of fatal exceptions that will make the failed record go straight to the DLT. Refer to Exception Classifier to see how to manage it.spring-doc.cn

You can now use blocking and non-blocking retries in conjunction. See Combining Blocking and Non-Blocking Retries for more information.spring-doc.cn

The KafkaBackOffException thrown when using the retryable topics feature is now logged at DEBUG level. See Changing KafkaBackOffException Logging Level if you need to change the logging level back to WARN or set it to any other level.spring-doc.cn