BAEL-7351 moving demo code to a spring-kafka-2 module

This commit is contained in:
s9m33r 2024-01-31 21:52:54 +05:30
parent d8e035da08
commit a516aca5c4
10 changed files with 8 additions and 93 deletions

View File

@ -1,33 +0,0 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

View File

@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath>
</parent>
<artifactId>apache-kafka-3</artifactId>
<name>Apache Kafka 3</name>
<description>Third module for Apache Kafka related articles</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</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>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -1 +0,0 @@
kafka.topic.name=test-topic

View File

@ -672,7 +672,6 @@
<module>apache-httpclient</module>
<module>apache-kafka</module>
<module>apache-kafka-2</module>
<module>apache-kafka-3</module>
<module>apache-libraries-2</module>
<module>apache-libraries</module>
<module>apache-olingo</module><!-- apache-olingo wasn't updated to boot-3 because a workaround for jakarta namespace wasn't found JAVA-27818 -->

View File

@ -1,4 +1,4 @@
package com.baeldung.apachekafka3.groupId;
package com.baeldung.spring.kafka.groupId;
import java.util.HashMap;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package com.baeldung.apachekafka3.groupId;
package com.baeldung.spring.kafka.groupId;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.common.errors.RecordDeserializationException;

View File

@ -1,11 +1,11 @@
package com.baeldung.apachekafka3.groupId;
package com.baeldung.spring.kafka.groupId;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = "com.baeldung.apachekafka3.groupId")
@ComponentScan(basePackages = "com.baeldung.spring.kafka.groupId")
public class Main {
public static void main(String[] args) {

View File

@ -1,4 +1,4 @@
package com.baeldung.apachekafka3.groupId;
package com.baeldung.spring.kafka.groupId;
import java.util.concurrent.CountDownLatch;

View File

@ -1,4 +1,4 @@
package com.baeldung.apachekafka3.groupId;
package com.baeldung.spring.kafka.groupId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -1,4 +1,4 @@
package com.baeldung.apachekafka3.groupId;
package com.baeldung.spring.kafka.groupId;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
@ -15,7 +15,7 @@ import org.springframework.kafka.test.context.EmbeddedKafka;
import org.springframework.test.annotation.DirtiesContext;
@SpringBootTest(classes = Main.class)
@ComponentScan(basePackages = "com.baeldung.apachekafka3.groupId")
@ComponentScan(basePackages = "com.baeldung.spring.kafka.groupId")
@DirtiesContext
@EmbeddedKafka(partitions = 4, topics = { "${kafka.topic.name:test-topic}" }, brokerProperties = { "listeners=PLAINTEXT://localhost:9092", "port=9092" })
public class MainLiveTest {