splitter: 1.0.0 - UPDATE 001 splitter-1.0.0
authorKai Moritz <kai@juplo.de>
Wed, 10 Jul 2024 14:33:52 +0000 (16:33 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 10 Jul 2024 15:08:46 +0000 (17:08 +0200)
Dockerfile
pom.xml
src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java
src/main/resources/application.properties [deleted file]
src/main/resources/application.yml [new file with mode: 0644]
src/test/resources/logback-test.xml [new file with mode: 0644]

index 803477f..3a77a14 100644 (file)
@@ -1,4 +1,4 @@
-FROM openjdk:11-jre-slim
+FROM eclipse-temurin:21-jre
 COPY target/*.jar /opt/app.jar
 EXPOSE 8086
 ENTRYPOINT ["java", "-jar", "/opt/app.jar"]
diff --git a/pom.xml b/pom.xml
index 54df55f..f9ff08c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -5,18 +5,17 @@
        <parent>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
-               <version>2.5.4</version>
+               <version>3.2.7</version>
                <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>de.juplo.kafka.wordcount</groupId>
        <artifactId>splitter</artifactId>
-       <version>1.0.0</version>
+       <version>1.0.0.001</version>
        <name>Wordcount-Splitter</name>
        <description>Stream-processor of the multi-user wordcount-example, that splits the sentences up into single words</description>
        <properties>
-               <docker-maven-plugin.version>0.33.0</docker-maven-plugin.version>
-               <java.version>11</java.version>
-               <kafka.version>2.8.0</kafka.version>
+               <java.version>21</java.version>
+               <docker-maven-plugin.version>0.44.0</docker-maven-plugin.version>
        </properties>
        <dependencies>
                <dependency>
                        <groupId>org.apache.kafka</groupId>
                        <artifactId>kafka-streams</artifactId>
                </dependency>
+               <dependency>
+                       <groupId>org.springframework.kafka</groupId>
+                       <artifactId>spring-kafka</artifactId>
+               </dependency>
 
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>lombok</artifactId>
                        <optional>true</optional>
                </dependency>
+
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-test</artifactId>
                        <scope>test</scope>
                </dependency>
+               <dependency>
+                       <groupId>org.springframework.kafka</groupId>
+                       <artifactId>spring-kafka-test</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.awaitility</groupId>
+                       <artifactId>awaitility</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.assertj</groupId>
+                       <artifactId>assertj-core</artifactId>
+                       <scope>test</scope>
+               </dependency>
        </dependencies>
 
        <build>
                <plugins>
+                       <plugin>
+                               <artifactId>maven-failsafe-plugin</artifactId>
+                       </plugin>
                        <plugin>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-maven-plugin</artifactId>
index 7218d6f..3eca8f4 100644 (file)
@@ -11,8 +11,8 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.PreDestroy;
 import java.util.Arrays;
 import java.util.Properties;
 import java.util.concurrent.CompletableFuture;
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
deleted file mode 100644 (file)
index 3046fc3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-server.port=8086
-management.endpoints.web.exposure.include=*
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
new file mode 100644 (file)
index 0000000..385daaa
--- /dev/null
@@ -0,0 +1,7 @@
+server:
+  port: 8086
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml
new file mode 100644 (file)
index 0000000..6f4bdf8
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <include resource="org/springframework/boot/logging/logback/base.xml" />
+    <logger name="de.juplo.kafka.wordcount.splitter" level="DEBUG" />
+</configuration>