본문 바로가기

MSA

34. micro service에 Kafka 적용 #2 (producer)

1. dependency 추가

3.0.0은 다음과 같은 오류로 downgrade Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.kafka.ConcurrentKafkaListenerContainerFactoryConfigurer and org.springframework.kafka.listener.ConsumerProperties Process finished with exit code 0
producer serice(order-ms)

2. KafkaProducerConfig class

3. KafkaProducer class

4. Producer Controller에 주입

5. Producer Controller의 method 구현

당연하지만 topic name은 consumer와 동일