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 살펴보기 #3

Closed
9 tasks done
djkeh opened this issue Jul 11, 2021 · 0 comments · Fixed by #4
Closed
9 tasks done

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

djkeh opened this issue Jul 11, 2021 · 0 comments · Fixed by #4
Assignees
Labels
enhancement New feature or request

Comments

@djkeh
Copy link
Owner

djkeh commented Jul 11, 2021

스프링 부트 2.4 에 새로운 내용들을 살펴보고 실험해본다.

  • Logback 설정 변경, property migrator
  • Startup logging
  • Constructor binding
  • ApplicationStartup metrics, Flight Recorder
  • Application properties 변경점: .properties 파일을 yaml 처럼 사용하기
  • spring.config.import: 프로파일에 따라 파일을 나누는(application-{profile}.properties) 방법에 대한 대안
  • 확장자 없는 프로퍼티 파일 읽기: sample[.properties]
  • Origin chain
  • Config Tree: "Kubernetes Volume Mounted Secrets" 방식
@djkeh djkeh added the enhancement New feature or request label Jul 11, 2021
@djkeh djkeh self-assigned this Jul 11, 2021
djkeh added a commit that referenced this issue Jul 11, 2021
넣어보고, 프로퍼티에 과거 로그백 설정 세팅
테스트 돌리니 안내 문구 표시되는 것 확인

```
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
```
djkeh added a commit that referenced this issue Jul 11, 2021
가이드에 맞게 수정하고 안내 문구 사라짐 확인
djkeh added a commit that referenced this issue Jul 12, 2021
액츄에이터, configuration processor 의존성 추가

* configuration processor: `annotationProcessor`를 사용해야 함
* ConfigurationProperties 클래스의 메타 정보를 .properties 파일과 이어주는 기능
djkeh added a commit that referenced this issue Jul 12, 2021
여러 방법으로 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 파일
djkeh added a commit that referenced this issue Jul 12, 2021
config tree 하면 `Duration` 타입 convert 안 되는
버그 발견.
알고 보니 2.4.1 에서 패치됐다.

* spring-projects/spring-boot#24171
djkeh added a commit that referenced this issue Jul 12, 2021
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 this to To do in 패스트캠퍼스 강의자료 만들기 1.0 via automation Jul 17, 2021
@djkeh djkeh added this to the 강의 제작 v1 milestone Jul 17, 2021
@djkeh djkeh linked a pull request Jul 17, 2021 that will close this issue
@djkeh djkeh removed a link to a pull request Jul 17, 2021
@djkeh djkeh moved this from To do to In progress in 패스트캠퍼스 강의자료 만들기 1.0 Jul 17, 2021
@djkeh djkeh moved this from In progress to Done in 패스트캠퍼스 강의자료 만들기 1.0 Jul 17, 2021
@djkeh djkeh closed this as completed in #4 Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant