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

Commits on Jul 11, 2021

  1. Add #3 - properties migrator

    넣어보고, 프로퍼티에 과거 로그백 설정 세팅
    테스트 돌리니 안내 문구 표시되는 것 확인
    
    ```
    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 committed Jul 11, 2021
    Configuration menu
    Copy the full SHA
    c60f23a View commit details
    Browse the repository at this point in the history
  2. Update #3 - logback properties following the guide

    가이드에 맞게 수정하고 안내 문구 사라짐 확인
    djkeh committed Jul 11, 2021
    Configuration menu
    Copy the full SHA
    919667c View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2021

  1. Add #3 - actuator, configuration processor

    액츄에이터, configuration processor 의존성 추가
    
    * configuration processor: `annotationProcessor`를 사용해야 함
    * ConfigurationProperties 클래스의 메타 정보를 .properties 파일과 이어주는 기능
    djkeh committed Jul 12, 2021
    Configuration menu
    Copy the full SHA
    c59068d View commit details
    Browse the repository at this point in the history
  2. Experiment #3 - configuration properties in variety of methods

    여러 방법으로 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 committed Jul 12, 2021
    Configuration menu
    Copy the full SHA
    ee1f206 View commit details
    Browse the repository at this point in the history
  3. Fix #3 - config tree 버그

    config tree 하면 `Duration` 타입 convert 안 되는
    버그 발견.
    알고 보니 2.4.1 에서 패치됐다.
    
    * spring-projects/spring-boot#24171
    djkeh committed Jul 12, 2021
    Configuration menu
    Copy the full SHA
    d1c1b7f View commit details
    Browse the repository at this point in the history
  4. Experiment #3 - 프로파일러 테스트

    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 committed Jul 12, 2021
    Configuration menu
    Copy the full SHA
    6c42955 View commit details
    Browse the repository at this point in the history