Spring for Apache Kafka 2.1.0.RELEASE (and 1.3.2, 2.0.2) Available
I am pleased to announce the availability of Spring for Apache Kafka 2.1.0.RELEASE.
In addition, maintenance releases 1.3.2.RELEASE and 2.0.2.RELEASE are available, containing important bug fixes. See also below for information about spring-integration-kafka
3.0.0.RELEASE. It is recommended that all users upgrade.
The main purpose of the 2.1 release is to upgrade the kafka-clients
library to 1.0.0, but we have included a few improvements:
-
Sometimes, when a message can’t be processed, you may wish to stop the container so the condition can be corrected and the message re-delivered. The framework now provides the
ContainerStoppingErrorHandler
for record listeners andContainerStoppingBatchErrorHandler
for batch listeners. -
The
KafkaAdmin
now supports increasing partitions when aNewTopic
bean is detected with a larger number of partitions than currently exist on the topic. -
StringJsonMessageConverter
andJsonSerializer/JsonDeserializer
now pass and consume type information inHeaders
. This allows multiple types to be easily sent/received on the same topic:@SpringBootApplication public class Kafka21Application {
public static void main(String[] args) { SpringApplication.run(Kafka21Application.class, args) .close(); } @Bean public ApplicationRunner runner(KafkaTemplate<Object, Object> template) { return args -> { template.send(MessageBuilder.withPayload(42) .setHeader(KafkaHeaders.TOPIC, "blog") .build()); template.send(MessageBuilder.withPayload("4…