Spring for Apache Kafka 2.2 釋出
Spring for Apache Kafka 2.2ofollow,noindex">釋出了 ,雖然 2.1.x 版本與 2.0.0 kafka-clients jar 相相容(自 2.1.9 起),但此版本要求 2.0.0(並提供 2.0.0 嵌入式代理以進行測試)。
更新亮點:
-
The
SeekToCurrentErrorHandler
can now "skip" records that fail repeatedly -
Such "skipped" records can be published to a dead-letter topic (or otherwise disposed of by application code)
-
Headers are added with diagnostics about the failure
-
When using transactions, the same functionality can be achieved with the default
AfterRollbackProcessor
-
You can now use the listener container factory to create any arbitrary listener container, not just containers for
@KafkaListener
s -
This allows more convenient use of Spring Boot’s auto configuration properties for any container
-
@KafkaListener
annotations can now override the container factory’sconcurrency
andautoStartup
properties -
The new
ErrorhandlingDeserializer
can catch deserialization exceptions which are then routed to theErrorHandler
-
The embedded kafka broker can now be used with JUnit 5 tests
有關更多資訊,請參閱文件中的“新增內容” 一章和更新日誌 。
此外,Spring Integration for Apache Kafka (spring-integration-kafka) 3.1.0.RELEASE 也已釋出,它基於 Spring for Apache Kafka 2.2 和 Spring Integration 5.1。
Spring for Apache Kafka (spring-kafka) 專案將核心 Spring 概念應用於基於 Kafka 的訊息傳遞解決方案。它提供了一個“模板”作為傳送訊息的高階抽象。它還為帶有 @KafkaListener 註解和“偵聽器容器(listener container)”的訊息驅動的 POJO 提供支援。這些庫促進了依賴注入和宣告的使用。在所有這些情況下,您將看到 Spring Framework 中的 JMS 支援和 Spring AMQP 中的 RabbitMQ 支援的相似之處。