refactor(services): 개발 , 운영 설정 분리

- cloud config 서버에 운영설정 저장
- profile을 통해서 운영/개발 설정분리
This commit is contained in:
hoon7566
2022-03-11 13:24:46 +09:00
parent 55ec97af93
commit 7cda31c68a
10 changed files with 41 additions and 9 deletions

View File

@@ -33,6 +33,8 @@ dependencies {
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'

View File

@@ -18,8 +18,11 @@ eureka:
spring:
application:
name: customer-apigateway-service
config:
import: optional:configserver:http://127.0.0.1:8888
cloud:
config:
name: bootstrap
gateway:
default-filters:
- name: GlobalFilter

View File

@@ -34,7 +34,7 @@ dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
/*implementation 'org.springframework.boot:spring-boot-starter-amqp'*/
/*implementation 'org.springframework.cloud:spring-cloud-starter-config'*/
implementation 'org.springframework.cloud:spring-cloud-starter-config'
/*implementation 'org.springframework.kafka:spring-kafka'*/
// https://mvnrepository.com/artifact/com.github.gavlyukovskiy/p6spy-spring-boot-starter
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.0'

View File

@@ -3,6 +3,11 @@ server.port: 0
spring:
application:
name: notification-service
config:
import: optional:configserver:http://127.0.0.1:8888
cloud:
config:
name: service
datasource:
url: jdbc:postgresql://localhost:5432/notificationdb
@@ -12,7 +17,7 @@ spring:
jpa:
hibernate:
ddl-auto: validate
ddl-auto: create-drop
generate-ddl: true
open-in-view: false
properties:

View File

@@ -34,7 +34,7 @@ dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
/*implementation 'org.springframework.boot:spring-boot-starter-amqp'*/
/*implementation 'org.springframework.boot:spring-boot-starter-security'*/
/*implementation 'org.springframework.cloud:spring-cloud-starter-config'*/
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.kafka:spring-kafka'
// https://mvnrepository.com/artifact/com.github.gavlyukovskiy/p6spy-spring-boot-starter
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.0'

View File

@@ -4,6 +4,11 @@ server:
spring:
application:
name: order-servcie
config:
import: optional:configserver:http://127.0.0.1:8888
cloud:
config:
name: service
jpa:
hibernate:

View File

@@ -32,6 +32,7 @@ dependencies {
implementation 'io.netty:netty-resolver-dns-native-macos:4.1.68.Final:osx-aarch_64'
// https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'

View File

@@ -3,16 +3,24 @@ server:
eureka:
client:
fetch-registry: true
register-with-eureka: true
service-url:
defalutZone: http://localhost:8761/eureka
fetch-registry: true
register-with-eureka: true
defaultZone: http://localhost:8761/eureka
spring:
application:
name: owner-apigateway-service
profiles:
default: dev
config:
import: optional:configserver:http://127.0.0.1:8888
cloud:
config:
name: bootstrap
gateway:
default-filters:
- name: GlobalFilter
@@ -93,6 +101,7 @@ spring:
- RewritePath=/user-service/(?<segment>.*),/$\{segment}
- AuthorizationHeaderFilter
token:
access-expired-time: 3600000
refresh-expired-time: 604800000

View File

@@ -34,14 +34,16 @@ dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
/*implementation 'org.springframework.boot:spring-boot-starter-amqp'*/
/*implementation 'org.springframework.boot:spring-boot-starter-security'*/
/*implementation 'org.springframework.cloud:spring-cloud-starter-config'*/
implementation 'org.springframework.cloud:spring-cloud-starter-config'
/*implementation 'org.springframework.kafka:spring-kafka'*/
// https://mvnrepository.com/artifact/com.github.gavlyukovskiy/p6spy-spring-boot-starter
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.0'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// testImplementation 'org.springframework.amqp:spring-rabbit-test'

View File

@@ -4,6 +4,11 @@ server:
spring:
application:
name: store-servcie
config:
import: optional:configserver:http://127.0.0.1:8888
cloud:
config:
name: service
jpa:
hibernate: