-sonar
This commit is contained in:
@@ -13,3 +13,5 @@ ingress:
|
|||||||
extraEnv:
|
extraEnv:
|
||||||
- name: SERVER_PORT
|
- name: SERVER_PORT
|
||||||
value: "8080"
|
value: "8080"
|
||||||
|
- name: SETTINGS_TLE_MONITORING_SERVICE
|
||||||
|
value: "http://tle-monitoring-service:8080"
|
||||||
|
|||||||
@@ -12,3 +12,5 @@ ingress:
|
|||||||
extraEnv:
|
extraEnv:
|
||||||
- name: SERVER_PORT
|
- name: SERVER_PORT
|
||||||
value: "8080"
|
value: "8080"
|
||||||
|
- name: SETTINGS_TLE_MONITORING_SERVICE
|
||||||
|
value: "http://tle-monitoring-service:8080"
|
||||||
|
|||||||
+11
-5
@@ -16,17 +16,18 @@ class TleMonitoringService(webClientBuilderProvider: ObjectProvider<WebClient.Bu
|
|||||||
private val webClientBuilder: WebClient.Builder = webClientBuilderProvider.ifAvailable ?: WebClient.builder()
|
private val webClientBuilder: WebClient.Builder = webClientBuilderProvider.ifAvailable ?: WebClient.builder()
|
||||||
private val logger = LoggerFactory.getLogger(this::class.java)
|
private val logger = LoggerFactory.getLogger(this::class.java)
|
||||||
|
|
||||||
@Value("\${settings.tle-monitoring-service:tle-monitoring-service}")
|
@Value("\${settings.tle-monitoring-service:http://tle-monitoring-service:8080}")
|
||||||
private val tleMonitoringUrl: String = ""
|
private val tleMonitoringUrl: String = ""
|
||||||
|
|
||||||
fun allTles(): List<TLEExtensionDTO> {
|
fun allTles(): List<TLEExtensionDTO> {
|
||||||
logger.info("TLE monitoring client all TLE request started")
|
val baseUrl = tleMonitoringUrl.trimEnd('/')
|
||||||
|
logger.info("TLE monitoring client all TLE request started: baseUrl={}", baseUrl)
|
||||||
return runCatching {
|
return runCatching {
|
||||||
var records = emptyList<TLEExtensionDTO>()
|
var records = emptyList<TLEExtensionDTO>()
|
||||||
val durationMs = measureTimeMillis {
|
val durationMs = measureTimeMillis {
|
||||||
records = webClientBuilder.build()
|
records = webClientBuilder.build()
|
||||||
.get()
|
.get()
|
||||||
.uri("$tleMonitoringUrl/v1/api/tle")
|
.uri("$baseUrl/v1/api/tle")
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.onStatus({ status -> status.isError }, ::mapError)
|
.onStatus({ status -> status.isError }, ::mapError)
|
||||||
.bodyToFlux(TLEExtensionDTO::class.java)
|
.bodyToFlux(TLEExtensionDTO::class.java)
|
||||||
@@ -47,13 +48,18 @@ class TleMonitoringService(webClientBuilderProvider: ObjectProvider<WebClient.Bu
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun satelliteTles(satelliteId: Long): List<TLEExtensionDTO> {
|
fun satelliteTles(satelliteId: Long): List<TLEExtensionDTO> {
|
||||||
logger.info("TLE monitoring client satellite TLE request started: satelliteId={}", satelliteId)
|
val baseUrl = tleMonitoringUrl.trimEnd('/')
|
||||||
|
logger.info(
|
||||||
|
"TLE monitoring client satellite TLE request started: satelliteId={}, baseUrl={}",
|
||||||
|
satelliteId,
|
||||||
|
baseUrl
|
||||||
|
)
|
||||||
return runCatching {
|
return runCatching {
|
||||||
var records = emptyList<TLEExtensionDTO>()
|
var records = emptyList<TLEExtensionDTO>()
|
||||||
val durationMs = measureTimeMillis {
|
val durationMs = measureTimeMillis {
|
||||||
records = webClientBuilder.build()
|
records = webClientBuilder.build()
|
||||||
.get()
|
.get()
|
||||||
.uri("$tleMonitoringUrl/v1/api/tle/satellite/$satelliteId")
|
.uri("$baseUrl/v1/api/tle/satellite/$satelliteId")
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.onStatus({ status -> status.isError }, ::mapError)
|
.onStatus({ status -> status.isError }, ::mapError)
|
||||||
.bodyToFlux(TLEExtensionDTO::class.java)
|
.bodyToFlux(TLEExtensionDTO::class.java)
|
||||||
|
|||||||
Reference in New Issue
Block a user