diff options
| author | Jakub Lidke | 2023-07-27 11:23:47 +0200 |
|---|---|---|
| committer | Jakub Lidke | 2023-07-27 11:23:47 +0200 |
| commit | 4c0a444725f1107e44db41e509587b969a33ea4b (patch) | |
| tree | 413e56a2bb7409409dcb4a9d226475b174056f46 /src/main/kotlin/dev/dnpm/etl/processor | |
| parent | 0defbb05bac3f585e75d72c02c9168d1c2de1834 (diff) | |
fix: fix kafka key values + add missing component attribute
Diffstat (limited to 'src/main/kotlin/dev/dnpm/etl/processor')
| -rw-r--r-- | src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt b/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt index 9520caa..f83a2ab 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt @@ -23,7 +23,9 @@ import com.fasterxml.jackson.databind.ObjectMapper import de.ukw.ccc.bwhc.dto.MtbFile import org.slf4j.LoggerFactory import org.springframework.kafka.core.KafkaTemplate +import org.springframework.stereotype.Component +@Component class KafkaMtbFileSender( private val kafkaTemplate: KafkaTemplate<String, String>, private val objectMapper: ObjectMapper @@ -33,7 +35,7 @@ class KafkaMtbFileSender( override fun send(mtbFile: MtbFile): MtbFileSender.Response { return try { - kafkaTemplate.sendDefault(String.format("{\"pid\": %s, \"eid\": %s}", mtbFile.patient.id, + kafkaTemplate.sendDefault(String.format("{\"pid\": \"%s\", \"eid\": \"%s\"}", mtbFile.patient.id, mtbFile.episode.id), objectMapper.writeValueAsString(mtbFile)) logger.debug("Sent file via KafkaMtbFileSender") MtbFileSender.Response(MtbFileSender.ResponseStatus.UNKNOWN) |
