fixing gradle build
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Verwendet die zentrale Platform-BOM für konsistente Versionen
|
||||
api(projects.platform.platformDependencies)
|
||||
|
||||
// Explizite `api`-Abhängigkeit zum core-domain Modul.
|
||||
api(projects.core.coreDomain)
|
||||
|
||||
// --- Coroutines & Asynchronität ---
|
||||
@@ -24,6 +21,10 @@ dependencies {
|
||||
// --- Service Discovery ---
|
||||
api(libs.consul.client)
|
||||
|
||||
// --- Utilities ---
|
||||
// KORREKTUR: Fehlende Abhängigkeit für den BigDecimalSerializer hinzugefügt.
|
||||
api(libs.bignum)
|
||||
|
||||
// --- Testing ---
|
||||
testImplementation(projects.platform.platformTesting)
|
||||
}
|
||||
|
||||
+8
-10
@@ -1,15 +1,10 @@
|
||||
package at.mocode.core.utils.discovery
|
||||
|
||||
import at.mocode.core.utils.config.AppConfig // Angenommen, AppConfig ist jetzt eine Klasse
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import java.net.InetAddress
|
||||
import java.util.*
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import at.mocode.core.utils.config.AppConfig // AppConfig ist jetzt eine Klasse
|
||||
import com.orbitz.consul.Consul
|
||||
import com.orbitz.consul.model.agent.ImmutableRegistration
|
||||
import java.net.InetAddress
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Repräsentiert die Registrierung eines einzelnen Service-Exemplars bei Consul.
|
||||
@@ -29,7 +24,8 @@ class ServiceRegistration internal constructor(
|
||||
println("Service '${registration.name()}' mit ID '${registration.id()}' erfolgreich bei Consul registriert.")
|
||||
} catch (e: Exception) {
|
||||
println("FEHLER: Service-Registrierung bei Consul fehlgeschlagen: ${e.message}")
|
||||
// Optional: Fehler weiterwerfen, um den Anwendungsstart zu stoppen
|
||||
// Fehler weiterwerfen, um den Anwendungsstart zu stoppen
|
||||
throw IllegalStateException("Could not register service with Consul", e)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +66,8 @@ class ServiceRegistrar(private val appConfig: AppConfig) {
|
||||
|
||||
val healthCheck = ImmutableRegistration.RegCheck.http(
|
||||
"http://$hostAddress:$servicePort/health", // Standard-Health-Check-Pfad
|
||||
10L // Intervall in Sekunden
|
||||
10L, // Intervall in Sekunden
|
||||
5L // Timeout in Sekunden
|
||||
)
|
||||
|
||||
val registration = ImmutableRegistration.builder()
|
||||
@@ -88,6 +85,7 @@ class ServiceRegistrar(private val appConfig: AppConfig) {
|
||||
|
||||
// Fügt einen Shutdown-Hook hinzu, um den Service beim Beenden sauber zu deregistrieren
|
||||
Runtime.getRuntime().addShutdownHook(Thread {
|
||||
println("Shutdown-Hook: Deregistriere Service ${serviceId}...")
|
||||
serviceRegistration.deregister()
|
||||
})
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package at.mocode.core.utils.serialization
|
||||
|
||||
import com.benasher44.uuid.Uuid
|
||||
import com.benasher44.uuid.uuidFrom
|
||||
// KORREKTUR: Der Import wurde von java.math.BigDecimal auf die korrekte Bibliothek geändert.
|
||||
import com.ionspin.kotlin.bignum.decimal.BigDecimal
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.datetime.LocalDate
|
||||
|
||||
Reference in New Issue
Block a user