Vorlage spring-consumer--kafkalistener--vorlage---lvm-2-tage--easy-path
authorKai Moritz <kai@juplo.de>
Sat, 12 Nov 2022 22:10:09 +0000 (23:10 +0100)
committerKai Moritz <kai@juplo.de>
Wed, 23 Nov 2022 02:42:31 +0000 (03:42 +0100)
pom.xml
src/main/java/de/juplo/kafka/SimpleConsumer.java

diff --git a/pom.xml b/pom.xml
index b908802..6528ee9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
   <build>
     <plugins>
-      <plugin>
-        <groupId>pl.project13.maven</groupId>
-        <artifactId>git-commit-id-plugin</artifactId>
-      </plugin>
       <plugin>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-maven-plugin</artifactId>
index fe0479f..e9ce220 100644 (file)
@@ -17,17 +17,11 @@ public class SimpleConsumer
   private String id;
   private long consumed = 0;
 
-  @KafkaListener(topics = "${simple.consumer.topic}")
   private void handleRecord(
-    @Header(KafkaHeaders.RECEIVED_TOPIC)
     String topic,
-    @Header(KafkaHeaders.RECEIVED_PARTITION_ID)
     Integer partition,
-    @Header(KafkaHeaders.OFFSET)
     Long offset,
-    @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY)
     String key,
-    @Payload
     String value)
   {
     consumed++;