1. What’s New in 2.7 Since 2.6
This section covers the changes made from version 2.6 to version 2.7. For changes in earlier version, see [history].
1.1. Kafka Client Version
This version requires the 2.7.0 kafka-clients.
It is also compatible with the 2.8.0 clients, since version 2.7.1; see [update-deps].
1.2. Non-Blocking Delayed Retries Using Topics
This significant new feature is added in this release. When strict ordering is not important, failed deliveries can be sent to another topic to be consumed later. A series of such retry topics can be configured, with increasing delays. See [retry-topic] for more information.
1.3. Listener Container Changes
The onlyLogRecordMetadata container property is now true by default.
A new container property stopImmediate is now available.
See [container-props] for more information.
Error handlers that use a BackOff between delivery attempts (e.g. SeekToCurrentErrorHandler and DefaultAfterRollbackProcessor) will now exit the back off interval soon after the container is stopped, rather than delaying the stop.
See [after-rollback] and [seek-to-current] for more information.
Error handlers and after rollback processors that extend FailedRecordProcessor can now be configured with one or more RetryListener s to receive information about retry and recovery progress.
See See [after-rollback], [seek-to-current], and [recovering-batch-eh] for more information.
The RecordInterceptor now has additional methods called after the listener returns (normally, or by throwing an exception).
It also has a sub-interface ConsumerAwareRecordInterceptor.
In addition, there is now a BatchInterceptor for batch listeners.
See [message-listener-container] for more information.
1.4. @KafkaListener Changes
You can now validate the payload parameter of @KafkaHandler methods (class-level listeners).
See [kafka-validation] for more information.
You can now set the rawRecordHeader property on the MessagingMessageConverter and BatchMessagingMessageConverter which causes the raw ConsumerRecord to be added to the converted Message<?>.
This is useful, for example, if you wish to use a DeadLetterPublishingRecoverer in a listener error handler.
See [listener-error-handlers] for more information.
You can now modify @KafkaListener annotations during application initialization.
See [kafkalistener-attrs] for more information.
1.5. DeadLetterPublishingRecover Changes
Now, if both the key and value fail deserialization, the original values are published to the DLT.
Previously, the value was populated but the key DeserializationException remained in the headers.
There is a breaking API change, if you subclassed the recoverer and overrode the createProducerRecord method.
In addition, the recoverer verifies that the partition selected by the destination resolver actually exists before publishing to it.
See [dead-letters] for more information.
1.6. ChainedKafkaTransactionManager is Deprecated
See [transactions] for more information.
1.7. ReplyingKafkaTemplate Changes
There is now a mechanism to examine a reply and fail the future exceptionally if some condition exists.
Support for sending and receiving spring-messaging Message<?> s has been added.
See [replying-template] for more information.
1.8. Kafka Streams Changes
By default, the StreamsBuilderFactoryBean is now configured to not clean up local state.
See [streams-config] for more information.
1.9. KafkaAdmin Changes
New methods createOrModifyTopics and describeTopics have been added.
KafkaAdmin.NewTopics has been added to facilitate configuring multiple topics in a single bean.
See [configuring-topics] for more information.
1.10. MessageConverter Changes
It is now possible to add a spring-messaging SmartMessageConverter to the MessagingMessageConverter, allowing content negotiation based on the contentType header.
See [messaging-message-conversion] for more information.