diff --git a/spring-kafka/src/main/java/com/baeldung/countingmessages/KafkaCountingMessagesComponent.java b/spring-kafka/src/main/java/com/baeldung/countingmessages/KafkaCountingMessagesComponent.java index 91ce1b0cbe..89cd1c8dac 100644 --- a/spring-kafka/src/main/java/com/baeldung/countingmessages/KafkaCountingMessagesComponent.java +++ b/spring-kafka/src/main/java/com/baeldung/countingmessages/KafkaCountingMessagesComponent.java @@ -17,7 +17,7 @@ import java.util.stream.Collectors; @Component public class KafkaCountingMessagesComponent { - @Value(value = "${kafka.bootstrapAddress}") + @Value(value = "${spring.kafka.bootstrap-servers}") private String bootstrapAddress; public static Map props = new HashMap<>(); diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java index 5873bf86ce..e8aa63a88d 100644 --- a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java @@ -22,7 +22,7 @@ import org.springframework.kafka.support.serializer.JsonDeserializer; @Configuration public class KafkaConsumerConfig { - @Value(value = "${kafka.bootstrapAddress}") + @Value(value = "${spring.kafka.bootstrap-servers}") private String bootstrapAddress; public ConsumerFactory consumerFactory(String groupId) { diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java index 0612ade45d..da8b2bd1a6 100644 --- a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java @@ -16,7 +16,7 @@ import org.springframework.kafka.support.serializer.JsonSerializer; @Configuration public class KafkaProducerConfig { - @Value(value = "${kafka.bootstrapAddress}") + @Value(value = "${spring.kafka.bootstrap-servers}") private String bootstrapAddress; @Bean diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java index 9f14b5972d..6a20915699 100644 --- a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java @@ -13,7 +13,7 @@ import org.springframework.kafka.core.KafkaAdmin; @Configuration public class KafkaTopicConfig { - @Value(value = "${kafka.bootstrapAddress}") + @Value(value = "${spring.kafka.bootstrap-servers}") private String bootstrapAddress; @Value(value = "${message.topic.name}") diff --git a/spring-kafka/src/main/resources/application.properties b/spring-kafka/src/main/resources/application.properties index b1dc1ceaf5..c57537e2af 100644 --- a/spring-kafka/src/main/resources/application.properties +++ b/spring-kafka/src/main/resources/application.properties @@ -1,4 +1,4 @@ -kafka.bootstrapAddress=localhost:9092 +spring.kafka.bootstrap-servers=localhost:9092 message.topic.name=baeldung long.message.topic.name=longMessage greeting.topic.name=greeting