From e2dd145a7750d5c86505cc6cb1e03315b7eb97da Mon Sep 17 00:00:00 2001 From: kangeunchan Date: Fri, 15 Aug 2025 11:10:07 +0900 Subject: [PATCH] =?UTF-8?q?feat=20(=20#29=20)=20:=20=EC=8A=A4=ED=94=84?= =?UTF-8?q?=EB=A7=81=20=ED=81=B4=EB=9D=BC=EC=9A=B0=EB=93=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20Spring=20Cloud=20C?= =?UTF-8?q?onfig=20=EC=82=AC=EC=9A=A9=EC=9D=84=20=EC=9C=84=ED=95=9C=20?= =?UTF-8?q?=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildSrc/src/main/kotlin/Dependencies.kt | 3 ++ buildSrc/src/main/kotlin/DependencyVersion.kt | 2 ++ casper-user/build.gradle.kts | 9 ++++++ .../src/main/resources/application.yml | 28 ++++++++++++++----- 4 files changed, 35 insertions(+), 7 deletions(-) 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