
먼저 글 작성에 앞서 해당 시리즈는 Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA) 강의를 참고하여 필요한 내용들을 정리한 것임을 밝힙니다.
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
spring:
cloud:
config:
uri: http://localhost:[port] # config server 주소
name: eureka-service, rabbitmq, gateway, jwt, log, redis, swagger # 구성 파일 정보
management:
endpoints:
web:
exposure:
include: refresh, health, beans, httptrace # httptrace는 서비스들의 호출되는 상태, 반환이 처리되는 상태 같은 트레이싱을 처리
@Bean
public HttpTraceRepository httpTraceRepository() {
return new InMemoryHttpTraceRepository();
}
spring boot 3 이상 변경 사항
- HttpTrace가 HttpExchange로 변경되었음
- yaml에도 httptrace가 아닌 exchanges 추가
- 아래와 같이 bean 등록
@Bean public HttpExchangeRepository httpExchangeRepository() { return new InMemoryHttpExchangeRepository(); }
spring:
profiles:
active: dev