mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Upgrade to Kafka 2.5.1
Closes gh-22868
This commit is contained in:
parent
e8307178c3
commit
abf6123bae
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -949,7 +949,7 @@ bom {
|
||||
]
|
||||
}
|
||||
}
|
||||
library("Kafka", "2.5.0") {
|
||||
library("Kafka", "2.5.1") {
|
||||
group("org.apache.kafka") {
|
||||
modules = [
|
||||
"connect-api",
|
||||
|
Loading…
Reference in New Issue
Block a user