diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index f96af89..93c250f 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -48,4 +48,7 @@ object Dependencies { // Sentry const val SENTRY_SPRING_BOOT_STARTER = "io.sentry:sentry-spring-boot-starter-jakarta:${DependencyVersion.SENTRY}" + + // Spring Cloud Config + const val SPRING_CLOUD_STARTER_CONFIG = "org.springframework.cloud:spring-cloud-starter-config" } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/DependencyVersion.kt b/buildSrc/src/main/kotlin/DependencyVersion.kt index e721bbc..7cacdbc 100644 --- a/buildSrc/src/main/kotlin/DependencyVersion.kt +++ b/buildSrc/src/main/kotlin/DependencyVersion.kt @@ -17,4 +17,6 @@ object DependencyVersion { const val SWAGGER = "2.7.0" const val SENTRY = "7.14.0" + + const val SPRING_CLOUD = "2023.0.3" } \ No newline at end of file diff --git a/casper-user/build.gradle.kts b/casper-user/build.gradle.kts index fff5b3d..9fc29a3 100644 --- a/casper-user/build.gradle.kts +++ b/casper-user/build.gradle.kts @@ -11,6 +11,12 @@ plugins { id(Plugin.PROTOBUF) version PluginVersion.PROTOBUF_VERSION } +dependencyManagement { + imports { + mavenBom("org.springframework.cloud:spring-cloud-dependencies:${DependencyVersion.SPRING_CLOUD}") + } +} + dependencies { // 스프링 부트 기본 기능 implementation(Dependencies.SPRING_BOOT_STARTER) @@ -70,6 +76,9 @@ dependencies { // Sentry implementation(Dependencies.SENTRY_SPRING_BOOT_STARTER) + + // Spring Cloud Config + implementation(Dependencies.SPRING_CLOUD_STARTER_CONFIG) } protobuf { diff --git a/casper-user/src/main/resources/application.yml b/casper-user/src/main/resources/application.yml index 980ed7b..31dc340 100644 --- a/casper-user/src/main/resources/application.yml +++ b/casper-user/src/main/resources/application.yml @@ -1,8 +1,22 @@ -grpc: - server: - port: 9090 - max-inbound-message-size: 3MB +spring: + application: + name: Casper-User + config: + import: "configserver:${CONFIG_SERVER_URL}" + cloud: + config: + label: main + fail-fast: true + retry: + initial-interval: 1000 + max-attempts: 6 + max-interval: 2000 + multiplier: 1.1 + profiles: + active: ${SPRING_PROFILES_ACTIVE} -app: - encryption: - key: "@qkrwndnjs12" \ No newline at end of file +management: + endpoints: + web: + exposure: + include: health,info,refresh