File tree Expand file tree Collapse file tree
casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/event/producer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package hs.kr.entrydsm.application.domain.application.event.producer
2+
3+ import com.fasterxml.jackson.databind.ObjectMapper
4+ import hs.kr.entrydsm.application.domain.application.event.dto.CreateApplicationEvent
5+ import hs.kr.entrydsm.application.global.kafka.configuration.KafkaTopics
6+ import hs.kr.entrydsm.domain.application.interfaces.ApplicationCreateEventContract
7+ import org.springframework.kafka.core.KafkaTemplate
8+ import org.springframework.stereotype.Component
9+ import java.util.UUID
10+
11+ @Component
12+ class ApplicationEventProducer (
13+ private val mapper : ObjectMapper ,
14+ private val createApplicationTemplate : KafkaTemplate <String , Any >
15+ ): ApplicationCreateEventContract {
16+
17+ override fun publishCreateApplication (receiptCode : Long , userId : UUID ) {
18+ val createApplicationEvent = CreateApplicationEvent (receiptCode, userId)
19+ createApplicationTemplate.send(
20+ KafkaTopics .CREATE_APPLICATION ,
21+ mapper.writeValueAsString(createApplicationEvent)
22+ )
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments