Remove outdated BillingController implementation, resolve conflicting bean definitions across modules, and retain the updated BillingController for consistency with frontend API logic.
This commit is contained in:
+22
-1
@@ -1,8 +1,12 @@
|
||||
package at.mocode.masterdata.service
|
||||
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent
|
||||
import org.springframework.boot.runApplication
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
|
||||
import org.springframework.context.event.EventListener
|
||||
import org.springframework.core.env.Environment
|
||||
|
||||
/**
|
||||
* Main application class for the Masterdata Service.
|
||||
@@ -11,7 +15,24 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
class MasterdataServiceApplication
|
||||
class MasterdataServiceApplication(private val env: Environment) {
|
||||
|
||||
private val log = LoggerFactory.getLogger(MasterdataServiceApplication::class.java)
|
||||
|
||||
@EventListener(ApplicationReadyEvent::class)
|
||||
fun onApplicationReady() {
|
||||
val springPort = env.getProperty("server.port", "8086")
|
||||
val ktorPort = env.getProperty("masterdata.http.port", "8091")
|
||||
val appName = env.getProperty("spring.application.name", "masterdata-service")
|
||||
|
||||
log.info("----------------------------------------------------------")
|
||||
log.info("Application '{}' is running!", appName)
|
||||
log.info("Spring Management Port: {}", springPort)
|
||||
log.info("Ktor API Port: {}", ktorPort)
|
||||
log.info("Profiles: {}", env.activeProfiles.joinToString(", "))
|
||||
log.info("----------------------------------------------------------")
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
// Starte die Spring Boot Anwendung.
|
||||
|
||||
+8
@@ -54,6 +54,14 @@ class KtorServerConfiguration {
|
||||
)
|
||||
}
|
||||
engine.start(wait = false)
|
||||
|
||||
// Graceful Shutdown sicherstellen
|
||||
Runtime.getRuntime().addShutdownHook(Thread {
|
||||
log.info("Stopping Masterdata Ktor server...")
|
||||
engine.stop(3000, 5000)
|
||||
log.info("Masterdata Ktor server stopped.")
|
||||
})
|
||||
|
||||
return engine
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,13 @@ spring:
|
||||
discovery:
|
||||
enabled: ${CONSUL_ENABLED:true}
|
||||
register: ${CONSUL_ENABLED:true}
|
||||
prefer-ip-address: true # Nutze IP im Docker-Netzwerk
|
||||
health-check-path: /actuator/health
|
||||
health-check-interval: 10s
|
||||
health-check-port: 8086
|
||||
instance-id: ${spring.application.name}-${server.port}-${random.uuid}
|
||||
health-check-port: ${server.port} # Health Check läuft auf Spring Port
|
||||
instance-id: ${spring.application.name}:${server.port}:${random.uuid}
|
||||
service-name: ${spring.application.name}
|
||||
port: 8091
|
||||
port: ${masterdata.http.port} # Ktor API Port registrieren
|
||||
|
||||
server:
|
||||
port: 8086 # Spring Boot Management Port (Actuator & Tomcat)
|
||||
|
||||
Reference in New Issue
Block a user