update admin and client config

This commit is contained in:
2019-12-19 12:05:19 +07:00
parent e77a06e904
commit 6be2f950f6
9 changed files with 63 additions and 1 deletions

View File

@@ -1,9 +1,11 @@
package com.cubetiqs.ops.admin
import de.codecentric.boot.admin.server.config.EnableAdminServer
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
@SpringBootApplication
@EnableAdminServer
class AdminApplication
fun main(args: Array<String>) {

View File

@@ -0,0 +1,16 @@
package com.cubetiqs.ops.admin.indicator
import org.springframework.boot.actuate.health.Health
import org.springframework.boot.actuate.health.ReactiveHealthIndicator
import reactor.core.publisher.Mono
@Indicator
class DownstreamServiceHealthIndicator : ReactiveHealthIndicator {
override fun health(): Mono<Health?>? {
return checkDownstreamServiceHealth()?.onErrorResume { Mono.just(Health.Builder().down(it).build()) }
}
private fun checkDownstreamServiceHealth(): Mono<Health?>? {
return Mono.just(Health.Builder().up().build())
}
}

View File

@@ -0,0 +1,12 @@
package com.cubetiqs.ops.admin.indicator
import org.springframework.stereotype.Component
/**
* @author sombochea
* @since 1.0
*/
@kotlin.annotation.Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS)
@Component
annotation class Indicator(val value: String = "")

View File

@@ -0,0 +1,20 @@
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-components: always
show-details: always
spring:
boot:
admin:
client:
enabled: true
url: http://localhost:7658
data:
mongodb:
uri: mongodb://192.168.0.150/admin
application:
name: admin

View File

@@ -1 +0,0 @@
server.port=7658

View File

@@ -0,0 +1,5 @@
server:
port: 7658
spring:
profiles:
active: dev