From c2026bdd077cd6513c91c3111efbeae5c4e9eb58 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Thu, 11 Jan 2024 08:51:30 +0100 Subject: [PATCH] feat: show configured endpoints --- .../dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt | 4 ++++ .../kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt | 2 ++ .../dev/dnpm/etl/processor/output/RestMtbFileSender.kt | 4 ++++ .../kotlin/dev/dnpm/etl/processor/web/ConfigController.kt | 1 + src/main/resources/templates/configs.html | 7 ++++--- 5 files changed, 15 insertions(+), 3 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 8c244b8..01c7d43 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/output/KafkaMtbFileSender.kt @@ -89,6 +89,10 @@ class KafkaMtbFileSender( } } + override fun endpoint(): String { + return "${this.kafkaTargetProperties.servers} (${this.kafkaTargetProperties.topic}/${this.kafkaTargetProperties.responseTopic})" + } + private fun key(request: MtbFileSender.MtbFileRequest): String { return "{\"pid\": \"${request.mtbFile.patient.id}\", " + "\"eid\": \"${request.mtbFile.episode.id}\"}" diff --git a/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt b/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt index de0efaa..aca972b 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/output/MtbFileSender.kt @@ -28,6 +28,8 @@ interface MtbFileSender { fun send(request: DeleteRequest): Response + fun endpoint(): String + data class Response(val status: RequestStatus, val body: String = "") data class MtbFileRequest(val requestId: String, val mtbFile: MtbFile) diff --git a/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt b/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt index 5a4ae9e..e1aecb7 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/output/RestMtbFileSender.kt @@ -90,4 +90,8 @@ class RestMtbFileSender( return MtbFileSender.Response(RequestStatus.ERROR, "Sonstiger Fehler bei der Übertragung") } + override fun endpoint(): String { + return this.restTargetProperties.uri.orEmpty() + } + } \ No newline at end of file diff --git a/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt b/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt index 7bdbb82..82c1fc0 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/web/ConfigController.kt @@ -42,6 +42,7 @@ class ConfigController( fun index(model: Model): String { model.addAttribute("pseudonymGenerator", pseudonymGenerator.javaClass.simpleName) model.addAttribute("mtbFileSender", mtbFileSender.javaClass.simpleName) + model.addAttribute("mtbFileEndpoint", mtbFileSender.endpoint()) model.addAttribute("connectionAvailable", connectionCheckService.connectionAvailable()) model.addAttribute("transformations", transformationService.getTransformations()) diff --git a/src/main/resources/templates/configs.html b/src/main/resources/templates/configs.html index a5b56d7..cb78e3d 100644 --- a/src/main/resources/templates/configs.html +++ b/src/main/resources/templates/configs.html @@ -29,8 +29,9 @@ [[ ${mtbFileSender} ]] - Endpunkt - [[ ${mtbFileSender} ]] + REST-Endpunkt + Kafka-Broker und Topics + [[ ${mtbFileEndpoint} ]] @@ -43,7 +44,7 @@ verfügbar. nicht verfügbar. -
+
ETL-Processor bwHC-Backend