Upgrade to Kafka 2.5.1

Closes gh-22868
This commit is contained in:
Andy Wilkinson 2020-08-11 12:17:26 +01:00
parent e8307178c3
commit abf6123bae
3 changed files with 26 additions and 2 deletions

View File

@ -16,12 +16,19 @@
package org.springframework.boot.actuate.autoconfigure.metrics;
import java.util.regex.Pattern;
import org.apache.kafka.streams.StreamsBuilder;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KTable;
import org.apache.kafka.streams.kstream.Materialized;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.metrics.test.MetricsRun;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafkaStreams;
import org.springframework.kafka.config.StreamsBuilderFactoryBean;
@ -93,6 +100,12 @@ class KafkaMetricsAutoConfigurationTests {
@EnableKafkaStreams
static class EnableKafkaStreamsConfiguration {
@Bean
KTable<?, ?> table(StreamsBuilder builder) {
KStream<Object, Object> stream = builder.stream(Pattern.compile("test"));
return stream.groupByKey().count(Materialized.as("store"));
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,9 +18,14 @@ package org.springframework.boot.autoconfigure.kafka;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.apache.kafka.clients.admin.NewTopic;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.streams.StreamsBuilder;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KTable;
import org.apache.kafka.streams.kstream.Materialized;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
@ -124,6 +129,12 @@ class KafkaAutoConfigurationIntegrationTests {
@EnableKafkaStreams
static class KafkaStreamsConfig {
@Bean
KTable<?, ?> table(StreamsBuilder builder) {
KStream<Object, Object> stream = builder.stream(Pattern.compile("test"));
return stream.groupByKey().count(Materialized.as("store"));
}
}
static class Listener {

View File

@ -949,7 +949,7 @@ bom {
]
}
}
library("Kafka", "2.5.0") {
library("Kafka", "2.5.1") {
group("org.apache.kafka") {
modules = [
"connect-api",