From 47ebe46974dcd7c6078d7a9a7f0a541f39d82c64 Mon Sep 17 00:00:00 2001
From: Paul-Christian Volkmer
Date: Thu, 20 Mar 2025 14:39:40 +0100
Subject: feat: add checks for DNPM:DIP backend
Since DNPM:DIP responds with HTTP 404 on API base path, the Kaplan-Meier Config
endpoint will be used to check availability of DNPM:DIP backend API.
---
.../dnpm/etl/processor/monitoring/ConnectionCheckService.kt | 10 +++++++++-
.../resources/templates/configs/outputConnectionAvailable.html | 3 ++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt
index e70da3e..9d96654 100644
--- a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt
+++ b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ConnectionCheckService.kt
@@ -121,7 +121,15 @@ class RestConnectionCheckService(
fun check() {
result = try {
val available = restTemplate.getForEntity(
- restTargetProperties.uri?.replace("/etl/api", "").toString(),
+ if (restTargetProperties.isBwhc) {
+ UriComponentsBuilder.fromUriString(restTargetProperties.uri.toString()).path("").toUriString()
+ } else {
+ UriComponentsBuilder.fromUriString(restTargetProperties.uri.toString())
+ .pathSegment("mtb")
+ .pathSegment("kaplan-meier")
+ .pathSegment("config")
+ .toUriString()
+ },
String::class.java
).statusCode == HttpStatus.OK
diff --git a/src/main/resources/templates/configs/outputConnectionAvailable.html b/src/main/resources/templates/configs/outputConnectionAvailable.html
index 4b7f8d1..93ad549 100644
--- a/src/main/resources/templates/configs/outputConnectionAvailable.html
+++ b/src/main/resources/templates/configs/outputConnectionAvailable.html
@@ -20,7 +20,8 @@
ETL-Processor
- bwHC-Backend
+ bwHC-Backend
+ DNPM:DIP-Backend
Kafka-Broker
\ No newline at end of file
--
cgit v1.2.3