본문 바로가기
개발/Spring

Spring Boot 2.4.0 Release 주요 변경

by Remover 2020. 11. 14.
반응형

github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.4-Release-Notes

 

spring-projects/spring-boot

Spring Boot. Contribute to spring-projects/spring-boot development by creating an account on GitHub.

github.com

 

Spring Boot 2.4.0이 Release 되었습니다. 

 

1. Config File Processing

 

application.properties 및 application.yml 파일을 처리하는 방식이 개선되었습니다.

 

Multi-Document YAML 파일 사용시 '----' 구분자를 통해 Document를 구분하는데, 이 때 정의 순서대로 속성에 추가되도록 변경되었습니다.

기존에는 문서의 순서가 Profile을 기반으로 했지만 이제는 선언 순서대로라고 하네요.

 

2. Startup Endpoint

 

Applications Startup 시 정보를 볼 수 있습니다.

 

$ curl 'http://localhost:8080/actuator/startup' -i -X POST
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 907

{
  "springBootVersion" : "2.4.0",
  "timeline" : {
    "startTime" : "2020-11-12T13:59:10.667Z",
    "events" : [ {
      "startupStep" : {
        "name" : "spring.boot.application.starting",
        "id" : 1,
        "parentId" : 0,
        "tags" : [ {
          "key" : "mainApplicationClass",
          "value" : "com.example.startup.StartupApplication"
        } ]
      },
      "startTime" : "2020-11-12T13:59:10.755644578Z",
      "endTime" : "2020-11-12T13:59:10.755934253Z",
      "duration" : "PT0.000289675S"
    }, {
      "startupStep" : {
        "name" : "spring.beans.instantiate",
        "id" : 2,
        "parentId" : 0,
        "tags" : [ {
          "key" : "beanName",
          "value" : "homeController"
        } ]
      },
      "startTime" : "2020-11-12T13:59:10.755979603Z",
      "endTime" : "2020-11-12T13:59:10.755986027Z",
      "duration" : "PT0.000006424S"
    } ]
  }
}

이를 통해 Endpoint 시작 시 예상보다 오래걸리는 Bean을 식별하는데 도움이 될 것 같네요.

 

3. Docker / BuildPack 지원

 

2.3.0 RELEASE에도 Docker 관련 내용이 었었지만 2.4.0에서는 Build 시 Docker 이미지 Registry에 업로드까지 가능하다고 합니다.

 

 

4. JAVA 15 지원

JAVA 15버전을 지원한다고 합니다. 기존과 동일하게 Java11과 8도 호환된다고 합니다.

 

5. 종속성 업그레이드

 

6. JUnit 5의 Vintage Engine 제거

 

Vintage Engine이 제거되었습니다. Junit4를 사용하는 경우에는 아래와 같은 설정을 넣어야 합니다.

<dependency>
    <groupId>org.junit.vintage</groupId>
    <artifactId>junit-vintage-engine</artifactId>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
        </exclusion>
    </exclusions>
</dependency>

 

7. Logback Configuration Properties 변경

 

기존 변경
logging.pattern.rolling-file-name logging.logback.rollingpolicy.file-name-pattern
logging.file.clean-history-on-start logging.logback.rollingpolicy.clean-history-on-start
logging.file.max-size logging.logback.rollingpolicy.max-file-size
logging.file.total-size-cap logging.logback.rollingpolicy.total-size-cap
logging.file.max-history logging.logback.rollingpolicy.max-history

 

8. HTTP Track에서 Cookie Header를 제공 X

 

2.3.0 과 같이 Cookie Header를 보고 싶은 경우 설정이 필요합니다.

management.trace.http.include to cookies, errors, request-headers, response-headers

 

 

9. Custom Property name support

 

Property 설정 시 @Name Annotation을 지원합니다.

@ConfigurationProperties(prefix = "sample")
public class SampleConfigurationProperties {

  private final String importValue;

  public SampleConfigurationProperties(@Name("import") String importValue) {
    this.importValue = importValue;
  }

}

 

10. Redis 캐시 지표

 

Redis 캐싱을 사용하는 경우 Micrometer를 통해 캐시 통계를 노출 할 수 있습니다.

 number puts, gets and deletes as well as hits/misses. The number of pending requests and the lock wait duration are also recorded.

spring.cache.redis.enable-statistic: true

'개발 > Spring' 카테고리의 다른 글

Spring Boot 3 RC1 Release 변경점  (0) 2022.11.07
Logback의 level  (0) 2020.11.15

댓글