From e5cb7c8bdc55f9aa14545e48d76d62c2a8b06ada Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 14 Nov 2024 21:21:58 +0100 Subject: [PATCH] Code an die aktualisierten Versionen von Java und Spring Kafka angepasst --- src/main/java/de/juplo/kafka/ApplicationProperties.java | 5 ++--- src/main/java/de/juplo/kafka/ExampleConsumer.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/juplo/kafka/ApplicationProperties.java b/src/main/java/de/juplo/kafka/ApplicationProperties.java index b8caf5c..22c755e 100644 --- a/src/main/java/de/juplo/kafka/ApplicationProperties.java +++ b/src/main/java/de/juplo/kafka/ApplicationProperties.java @@ -1,13 +1,12 @@ package de.juplo.kafka; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; - @ConfigurationProperties(prefix = "juplo") @Validated diff --git a/src/main/java/de/juplo/kafka/ExampleConsumer.java b/src/main/java/de/juplo/kafka/ExampleConsumer.java index 4aa417b..f669452 100644 --- a/src/main/java/de/juplo/kafka/ExampleConsumer.java +++ b/src/main/java/de/juplo/kafka/ExampleConsumer.java @@ -21,11 +21,11 @@ public class ExampleConsumer private void handleRecord( @Header(KafkaHeaders.RECEIVED_TOPIC) String topic, - @Header(KafkaHeaders.RECEIVED_PARTITION_ID) + @Header(KafkaHeaders.RECEIVED_PARTITION) Integer partition, @Header(KafkaHeaders.OFFSET) Long offset, - @Header(KafkaHeaders.RECEIVED_MESSAGE_KEY) + @Header(KafkaHeaders.RECEIVED_KEY) String key, @Payload String value) -- 2.20.1