Bump libs up to latest

* Spring Boot 2.6.3
* Spring Cloud 2021.0.0
* SCS/F 3.2.1
* etc..

Partially resolves #156
This commit is contained in:
Chris Bono
2022-01-24 10:20:21 -06:00
committed by GitHub
parent a70383677b
commit 301ba872bb
45 changed files with 182 additions and 198 deletions

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<version>2.6.3</version>
<relativePath/>
</parent>
@@ -20,14 +20,14 @@
<dependency>
<groupId>org.springframework.cloud.stream.app</groupId>
<artifactId>app-starters-core-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<version>2.1.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud.stream.app</groupId>
<artifactId>http-app-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<version>2.1.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<version>2.6.3</version>
<relativePath/>
</parent>
@@ -23,7 +23,7 @@
<dependency>
<groupId>org.springframework.cloud.stream.app</groupId>
<artifactId>app-starters-core-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<version>2.1.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@@ -21,7 +21,7 @@ import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.kstream.Joined;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KTable;
import org.apache.kafka.streams.kstream.Serialized;
import org.apache.kafka.streams.kstream.Grouped;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
@@ -51,7 +51,7 @@ public class UserClicksAndUserRegionsProcessor {
(clicks, region) -> new RegionWithClicks(region == null ? "UNKNOWN" : region, clicks),
Joined.with(Serdes.String(), Serdes.Long(), null))
.map((user, regionWithClicks) -> new KeyValue<>(regionWithClicks.getRegion(), regionWithClicks.getClicks()))
.groupByKey(Serialized.with(Serdes.String(), Serdes.Long()))
.groupByKey(Grouped.with(Serdes.String(), Serdes.Long()))
.reduce((firstClicks, secondClicks) -> firstClicks + secondClicks)
.toStream();
}

View File

@@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<version>2.6.3</version>
<relativePath/>
</parent>
@@ -19,7 +19,7 @@
<dependency>
<groupId>org.springframework.cloud.stream.app</groupId>
<artifactId>app-starters-core-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<version>2.1.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@@ -36,7 +36,7 @@ public class UserClicksPerRegionLogger {
LoggingHandler loggingHandler = new LoggingHandler(LoggingHandler.Level.INFO) {
@Override
protected void handleMessageInternal(Message<?> message) throws Exception {
protected void handleMessageInternal(Message<?> message) {
Long userClicksPerRegion = (Long) message.getPayload();
String userRegion = (String) message.getHeaders().get("kafka_receivedMessageKey");
message = new MutableMessage<>(userRegion + " : " + userClicksPerRegion.toString());

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<version>2.6.3</version>
<relativePath/>
</parent>
@@ -23,7 +23,7 @@
<dependency>
<groupId>org.springframework.cloud.stream.app</groupId>
<artifactId>app-starters-core-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<version>2.1.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@@ -16,6 +16,7 @@
package org.springframework.cloud.dataflow.samples.processor;
import java.time.Duration;
import java.util.Arrays;
import java.util.Date;
@@ -23,7 +24,7 @@ import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.Materialized;
import org.apache.kafka.streams.kstream.Serialized;
import org.apache.kafka.streams.kstream.Grouped;
import org.apache.kafka.streams.kstream.TimeWindows;
import org.springframework.boot.SpringApplication;
@@ -50,8 +51,8 @@ public class KafkaStreamsWordCountApplication {
return input
.flatMapValues(value -> Arrays.asList(value.toLowerCase().split("\\W+")))
.map((key, value) -> new KeyValue<>(value, value))
.groupByKey(Serialized.with(Serdes.String(), Serdes.String()))
.windowedBy(TimeWindows.of(30000))
.groupByKey(Grouped.with(Serdes.String(), Serdes.String()))
.windowedBy(TimeWindows.of(Duration.ofSeconds(30L)))
.count(Materialized.as("WordCounts-1"))
.toStream()
.map((key, value) -> new KeyValue<>(null, new WordCount(key.key(), value, new Date(key.window().start()), new Date(key.window().end()))));