diff --git a/weather-service/src/main/java/com/waither/weatherservice/kafka/Consumer.java b/weather-service/src/main/java/com/waither/weatherservice/kafka/Consumer.java index b846262f..4afd624a 100644 --- a/weather-service/src/main/java/com/waither/weatherservice/kafka/Consumer.java +++ b/weather-service/src/main/java/com/waither/weatherservice/kafka/Consumer.java @@ -1,20 +1,15 @@ package com.waither.weatherservice.kafka; -import org.springframework.kafka.annotation.KafkaListener; -import org.springframework.stereotype.Component; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@Component -@RequiredArgsConstructor -public class Consumer { - - @KafkaListener(topics = "${spring.kafka.template.topic}", groupId = "${spring.kafka.consumer.group-id}") - public void dailyWeatherConsume(String message) { - - log.info("Consumer Test ========================== "); - log.info("[*] Consumer Message {} ", message); - } -} +// 테스트용 Consumer +// @Slf4j +// @Component +// @RequiredArgsConstructor +// public class Consumer { +// +// @KafkaListener(topics = "${spring.kafka.template.topic}", groupId = "${spring.kafka.consumer.group-id}") +// public void dailyWeatherConsume(String message) { +// +// log.info("Consumer Test ========================== "); +// log.info("[*] Consumer Message {} ", message); +// } +// } diff --git a/weather-service/src/main/java/com/waither/weatherservice/kafka/Producer.java b/weather-service/src/main/java/com/waither/weatherservice/kafka/Producer.java index 057fa514..868c2298 100644 --- a/weather-service/src/main/java/com/waither/weatherservice/kafka/Producer.java +++ b/weather-service/src/main/java/com/waither/weatherservice/kafka/Producer.java @@ -17,7 +17,7 @@ public class Producer { @Value("${spring.kafka.template.topic}") private String topic; - public void dailyWeatherProduceMessage(String message) { + public void produceMessage(String message) { log.info("[*] Producer Message : {}", message); kafkaTemplate.send(topic, message); } diff --git a/weather-service/src/main/java/com/waither/weatherservice/service/WeatherService.java b/weather-service/src/main/java/com/waither/weatherservice/service/WeatherService.java index fa7603b6..8d120d2c 100644 --- a/weather-service/src/main/java/com/waither/weatherservice/service/WeatherService.java +++ b/weather-service/src/main/java/com/waither/weatherservice/service/WeatherService.java @@ -61,7 +61,6 @@ public void createExpectedWeather( .expectedSky(expectedSkyList) .build(); - // TODO 조회 테스트 후 삭제 예정 ExpectedWeather save = expectedWeatherRepository.save(expectedWeather); log.info("[*] 예상 기후 : {}", save); } @@ -97,7 +96,8 @@ public void createDailyWeather(int nx, // DailyWeatherKafkaMessage kafkaMessage = DailyWeatherKafkaMessage.from(dailyWeather); - producer.dailyWeatherProduceMessage(wsd); + // 바람 세기 Kafka 전송 + producer.produceMessage(wsd); // DailyWeather save = dailyWeatherRepository.save(dailyWeather); log.info("[*] 하루 온도 : {}", dailyWeather); @@ -117,7 +117,6 @@ public void createDisasterMsg(String location) throws URISyntaxException, IOExce .message(msg) .build(); - // TODO 조회 테스트 후 삭제 예정 DisasterMessage save = disasterMessageRepository.save(disasterMessage); log.info("[*] 재난 문자 : {}", save); }