Category: Config

0

Spring Cloud - 25. Spring Cloud Config Native

목차 Spring Cloud - 25. Spring Cloud Config Native Spring Cloud - 24. Client Service 에서 Config Server 연동하기 Spring Cloud - 23. Spring Cloud Config Server 만들기 Spring Cloud - 22. Spring Cloud Config 연동 Actuator 2 Spring Cloud - 21. Spring Cloud Config 연동 Actuactor server: port: 8888spring: application: name: config-service profiles: active: native cloud: config: server: native: search-locations: file://${user.home}/dev/study/Spring-Cloud/gateway/git-local-repository#spring:# application:# name: config-service# cloud:# config:# server:# git:# uri: https://github.com/ckck803/spring-cloud-config## uri: file:///Users/dongwoo-yang/dev/study/Spring-Cloud/gateway/git-local-repository

0

Spring Cloud - 24. Client Service 에서 Config Server 연동하기

목차 Spring Cloud - 25. Spring Cloud Config Native Spring Cloud - 24. Client Service 에서 Config Server 연동하기 Spring Cloud - 23. Spring Cloud Config Server 만들기 Spring Cloud - 22. Spring Cloud Config 연동 Actuator 2 Spring Cloud - 21. Spring Cloud Config 연동 Actuactor Client Service 에서 Config Server 로부터 Config 파일 읽어오기// 외부 Config를 가져오기 위한 Dependency 설정implementation 'org.springframework.cloud:spring-cloud-config-server'implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' spring: cloud: config: uri: http://127.0.0.1:8888 name: ecommerce profiles: active: dev spring: cloud: config: uri: http://127.0.0.1:8888 name: ecommerce profiles: active: prod

0

Spring Cloud - 23. Spring Cloud Config Server 만들기

목차 Spring Cloud - 25. Spring Cloud Config Native Spring Cloud - 24. Client Service 에서 Config Server 연동하기 Spring Cloud - 23. Spring Cloud Config Server 만들기 Spring Cloud - 22. Spring Cloud Config 연동 Actuator 2 Spring Cloud - 21. Spring Cloud Config 연동 Actuactor Spring Cloud Config Server 의존성 추가// 외부 Config를 가져오기 위한 Dependency 설정implementation 'org.springframework.cloud:spring-cloud-config-server'implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' Config Server 만들기@EnableConfigServer 어노테이션을 추가하여 Config Server를 만들어 준다. @SpringBootApplication@EnableConfigServerpublic class ConfigServiceApplication { public static void main(String[] args) { SpringApplication.run(ConfigServiceApplication.class, args); }} Config 파일 읽어오기Config 파일 위치에 따라서 Spring Cloud Config Server 에서 Config 파일을 읽어오는 방식이 달라진다.

0

Spring Cloud - 22. Spring Cloud Config 연동 Actuator 2

목차 Spring Cloud - 25. Spring Cloud Config Native Spring Cloud - 24. Client Service 에서 Config Server 연동하기 Spring Cloud - 23. Spring Cloud Config Server 만들기 Spring Cloud - 22. Spring Cloud Config 연동 Actuator 2 Spring Cloud - 21. Spring Cloud Config 연동 Actuactor Spring Cloud로 개발하는 마이크로서비스 애플리케이션 22 - Spring Cloud Config 연동 Actuator 2// 외부 Config를 가져오기 위한 Dependency 설정implementation 'org.springframework.cloud:spring-cloud-starter-config'implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuatorimplementation 'org.springframework.boot:spring-boot-starter-actuator' spring: cloud: config: uri: http://127.0.0.1:8888 name: ecommerce @SpringBootApplicationpublic class ApigatewayServiceApplication { public static void main(String[] args) { SpringApplication.run(ApigatewayServiceApplication.class, args); } @Bean public HttpTraceRepository httpTraceRepository(){ return new InMemoryHttpTraceRepository(); }} server: port: 8080eureka: client: register-with-eureka: true fetch-registry: true service-url: defaultZone: http://localhost:8761/eurekaspring: application: name: apigateway-service cloud: gateway: default-filters: - name: GlobalFilter args: baseMessage: Spring Cloud Gateway Global Filter preLogger: true postLogger: true routes:# - id: user-service# uri: lb://USER-SERVICE# predicates:# - Path=/user-service/**# filters:# - CustomFilter - id: user-service uri: lb://USER-SERVICE predicates: - Path=/user-service/login - Method=POST filters: - RemoveRequestHeader=Cookie - RewritePath=/user-service/(?<segment>.*), /$\{segment} - id: user-service uri: lb://USER-SERVICE predicates: - Path=/user-service/users - Method=POST filters: - RemoveRequestHeader=Cookie - RewritePath=/user-service/(?<segment>.*), /$\{segment} - id: user-service uri: lb://USER-SERVICE predicates: - Path=/user-service/** - Method=GET filters: - RemoveRequestHeader=Cookie - RewritePath=/user-service/(?<segment>.*), /$\{segment} - AuthorizationHeaderFilter - id: user-service uri: lb://USER-SERVICE predicates: - Path=/user-service/actuator/** - Method=GET, POST filters: - RemoveRequestHeader=Cookie - RewritePath=/user-service/(?<segment>.*), /$\{segment} - id: catalog-service uri: lb://CATALOG-SERVICE predicates: - Path=/catalog-service/** filters: - CustomFilter - id: order-service uri: lb://ORDER-SERVICE predicates: - Path=/order-service/** filters: - CustomFiltertoken: secret: user_tokenmanagement: endpoints: web: exposure: include: refresh, health, beans, httptrace

0

Spring Cloud - 21. Spring Cloud Config 연동 Actuactor

목차 Spring Cloud - 25. Spring Cloud Config Native Spring Cloud - 24. Client Service 에서 Config Server 연동하기 Spring Cloud - 23. Spring Cloud Config Server 만들기 Spring Cloud - 22. Spring Cloud Config 연동 Actuator 2 Spring Cloud - 21. Spring Cloud Config 연동 Actuactor 참고 https://www.baeldung.com/spring-cloud-config-without-git https://mangkyu.tistory.com/253 Spring Cloud Config ServerSpring Cloud Config Server 의존성 추가// 외부 Config를 가져오기 위한 Dependency 설정implementation 'org.springframework.cloud:spring-cloud-config-server'implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap' /{application}/{profile}[/{label}]/{application}-{profile}.yml/{label}/{application}-{profile}.yml/{application}-{profile}.properties/{label}/{application}-{profile}.properties @EnableConfigServer 어노테이션을 추가하여 Config Server를 만들어 준다.