Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

스프링 부트 2.4 살펴보기 #4

Merged
merged 6 commits into from Jul 17, 2021
Merged

스프링 부트 2.4 살펴보기 #4

merged 6 commits into from Jul 17, 2021

Conversation

djkeh
Copy link
Owner

@djkeh djkeh commented Jul 12, 2021

스프링 부트 2.4 살펴보기 연습 내용

This closes #3

넣어보고, 프로퍼티에 과거 로그백 설정 세팅
테스트 돌리니 안내 문구 표시되는 것 확인

```
Property source 'Config resource 'classpath:/application.properties' via location 'optional:classpath:/'':
	Key: logging.pattern.rolling-file-name
		Line: 1
		Replacement: logging.logback.rollingpolicy.file-name-pattern
```
가이드에 맞게 수정하고 안내 문구 사라짐 확인
액츄에이터, configuration processor 의존성 추가

* configuration processor: `annotationProcessor`를 사용해야 함
* ConfigurationProperties 클래스의 메타 정보를 .properties 파일과 이어주는 기능
여러 방법으로 properties 사용 방법을 실험
행한 실험은:

* actuator endpoint 전부 개방
* `@ConstructorBinding` -> 2.2 기능
  * `@DefaultValue` -> 2.2 기능
  * `@DurationUnit`을 `@ConstructorBinding` 생성자에 사용
  * `@name`
* `.properties` 에 yaml 처럼 문서 구분하기
  * 프로파일 설정
  * 부트 프로퍼티 변화: `spring.profiles` -> `spring.config.activate.on-profile`
* `spring.config.import`
  * 여러개 `spring.config.import`
  * config tree
  * 확장자 없는 properties 파일
config tree 하면 `Duration` 타입 convert 안 되는
버그 발견.
알고 보니 2.4.1 에서 패치됐다.

* spring-projects/spring-boot#24171
Flight Recorder, BufferingApplicationStartup 테스트

* flight recorder
  * 코드 짠다
  * 프롬프트에서 `java -XX:StartFlightRecording:filename=recording.jfr,duration=10s -jar ${jar파일}` 로 부트 실행
    * 이 내용은 `FlightRecorderApplicationStartup` 안에 javadoc으로 가이드 되어 있음
  * 부트 실행 종료
  * 프로젝트 루트에서 `recording.jfr` 확인
  * JDK Mission Control 실행
  * 파일 로드
* BufferingApplicationStartup
  * 코드 구현
  * 평범하게 부트 실행
  * actuator로 `/startup` 항목 추가된 것 확인
  * POST 로 데이터 조회: `curl -X POST http://localhost:8080/actuator/startup | jq`
@djkeh djkeh added the wontfix This will not be worked on label Jul 12, 2021
@djkeh djkeh self-assigned this Jul 12, 2021
@djkeh djkeh merged commit caa8d07 into develop Jul 17, 2021
@djkeh djkeh deleted the feature/#3-boot-2.4 branch July 17, 2021 13:53
@djkeh djkeh restored the feature/#3-boot-2.4 branch July 17, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

스프링 부트 2.4 살펴보기
1 participant