Pyohwan / english-study

0 stars 0 forks source link

Spring Boot 2.1 Release Notes #21

Open Pyohwan opened 4 years ago

Pyohwan commented 4 years ago

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.1-Release-Notes

Upgrading from Spring Boot 2.0

Deprecations from Spring Boot 2.0

use the group (possibly in a different configuration file)

logging.level.tomcat=TRACE

* 편리한 `web`, `sql` groups 가 기본 제공(out-of-the-box) 된다
### Maven Plugin
* system properties, environment variables 의 아규먼트가 개선 되었으니 문세 참고해라
### Bootstrap mode for JPA setup
* Spring Data Lovelace 에서 `bootstrap mode` 모드 지원함
* JPA 부트스트랩 모드를 제어하는 예제

spring.data.jpa.repositories.bootstrap-mode=deferred

### Kafka Streams Support
* Kafa Streams 지원 가능. 자세한 내용은 문서 참고하라
### Spring Data JDBC Support
* Spring Data 에서 JDBC repository 지원, `CrudRepository` 에서 SQL 를 자동 생성한다.
### JMS ConnectionFactory Caching
* `CachingConnectionFactory` 에서 `ConnectionFactory` 가 자동 구성 됨 (spring.jms.cache.enabled=false 면 안함)
* Pooling 옵션에 Artemis 추가. (spring.jms.artemis.pool.*)
### Elasticsearch REST Clients
* Jest 대안으로 `RestClient` 와 `RestHighLevelClient` 가 제공된다
### JUnit 5
* 모든 `@…​Test` 는 ` @ExtendWith(SpringExtension.class)` 에 있으므로, 이제 중복으로 안해줘도 된다
* `maven-surefire-plugin` 안쓰므로 별도의 JUnit 5 설정이 필요
### Security
#### OAuth2 WebFlux Support
* WebFlux OAuth2 login 추가
#### OAuth2 resource server support
* `spring-security-oauth2-resource-server` 가 classpath 에 있고 JWK Set URI 가 지정되어 있으면, OAuth2 Resource Server 를 설정할 수 있다

spring.security.oauth2.resource.jwt.jwk.set-uri=https://example.com/oauth2/default/v1/keys

#### Non-web OAuth Applications
* `InMemoryReactiveClientRegistrationRepository` 이 제공되고 non-web OAuth 애플리케이션을 쉽게 작성가능하다.
  * 내장 웹서버를 사용하지 않을때 (CLI 애플리케이션) 쉽게 주입가능하다
### Actuator Endpoints
#### Caches Endpoint
* 사용 가능한 `CacheManager` 을 나열 가능 `/actuator/caches`
### Spring Integration Graph Endpoint
* Spring Integration 을 사용하면 `/actuator/integrationgraph` 로 그래프 표시 가능
#### Health Endpoint
* `HealthIndicatorRegistry` 으로 런타임 시 `HealthIndicator` 를 추가하고 제거 가능.
* 특정 지표를 쿼리 하도록 `health` endpoint 도 개선 됨
  * `/actuator/health/db` 는 "db" HealthIndicator 만 실행 함
* Apache Cassandra  를 위한 reactive `HealthIndicator` 사용 가능
### Micrometer
#### Common Micrometer Tags
* Common 태그를 모든 meters 에 선언적으로 사용 가능

management.metrics.tags.region=us-east-1 management.metrics.tags.stack=prod


* 모든 meters에 `region` and `stack` 값을 추가 함
#### Auto-configuration Support For New Metrics
* 지표 범위가 개선 됨
  * Hibernate metrics
  * Spring Framework’s WebClient
  * Kafka consumer metrics
  * Log4j2 metrics
  * Jetty server thread pool metrics
  * Server-side Jersey HTTP request metrics
#### Auto-configuration support for new registries
* classpath 에 있다면 자동 구성 됨
  * AppOptics
  * Humio
  * KariosDB
* Prometheus push gateway 추가 됨
#### Additional histogram configuration properties
* 새로운 `management.metrics.distribution.maximum-expected-value.*` 와 `management.metrics.distribution.minimum-expected-value.*` properties 로 미터 단위의 최소 최대값 조절 가능
### Miscellaneous
사소한 조정 및 개선 사항
* Jackson visibility 를 `spring.jackson.visiblity.*` 로 구성 가능
* 자동 구성된 `WebServiceTemplateBuilder` 로 `WebServiceTemplate` 를 만드는게 더 쉽다
* Devtools 사용할때에는 에러 페이지에 스택트레이스가 나옴
* Jersey 를 활성화 하기 위해 더이상 더미 `ResourceConfig` 를 export 안해도 됨
* 기본적으로 `resourceRef` 를 사용하도록 JNDI lookups 가 개선 됨
* Rabbit 인프라에서 사용하는 `RetryTemplate` 커스터마이징은 `RabbitRetryTemplateCustomizer` 로 하면 된다
* default `RabbitTemplate` 의 receive 큐를 구성 가능
* Tomcat’s max swallow size 는 이제 property 로 구성 가능
* HTTP/2 with Reactor Netty Server is now supported.
* Kafka auto-configuation 에서 `errorHandler` `transactionManager` and `afterRollbackProcessor` beans 지원
* 전역으로 unique JMX ObjectNames 생성 가능 (이 기능을 Actuator Endpoints 로 제한하지 않고)
* Configuration property meta-data 가 deprecated 된 마지막 아이템과 함께 정렬됨(?)
* `Health.Builder` 의 `withDetails` 메소드에서도 `Map` 승인 함
* issuer 가 정의되어 있으면 reactive `ReactiveJwtDecoder` 가 자동구성 됨
* `spring.backgroundpreinitializer.ignore` 이 설정되어 있으면 `BackgroundPreinitializer` 가 비활성화 됨
* `HiddenHttpMethodFilter` 는 property 로 비활성화 가능
* JAP starter POM 은 Java 9+ 에서 기본동작 함
* `com.mongodb.client.MongoClient` 가 정의되어 있으면 자동구성이 안됨
* 선택적으로 Jetty RS as HTTP driver for WebClient 사용 가능
* `spring.quartz` namespace 에 여러 구성 옵션이 추가 됨
* `@ConditionalOnEnabledEndpoint` 는 모든 구성요소에서 사용할 수 있다
* `Filter ` bean 이 missing 인지 `@ConditionalOnMissingServletFilter` 로 테스트 가능
* @WebMvcTest는 스프링 데이터 REST도 자동 구성합니다 (Sort, Pageable)
* Slice 테스트에서 환경을 일관되게 정의하기 위한 `properties` 이 있다
* 멀티플 `RestDocsMockMvcConfigurationCustomizer` 지원 함
* Security 구성이 `WebTestClient` 에 적용된다. 자세한건 문서 참고
*  @WebFluxTest에서 WebExceptionHandlers가 지원됩니다.
* @SpringBootTest (webEnvironment = WebEnvironment.RANDOM_PORT)는 이제 관리 서버에 대해 별도의 임의 포트를 생성 할 수 있습니다.
* Auto-configuration 제외가 이제 일관되게 적용됩니다.
## Deprecations in Spring Boot 2.1
* setConnectTimeout (int) 및 setReadTimeout (int)는 Duration 를 위해 더 이상 사용되지 않습니다.
* `int` 로 데이터 사이즈를 설정하는 Methods 는 안쓰고 대신에 DataSize 를 써라
* management.endpoints.jmx.unique-names -> spring.jmx.unique-names
* Spring Security의 @WithMockUser 주석을 사용하기 위해 @AutoConfigureMockMvc의 보안 속성이 더 이상 사용되지 않습니다.
* RestTemplateBuilder.basicAuthorization은 basicAuthentication을 위해 더 이상 사용되지 않습니다.
* REQUEST_WRAPPER_FILTER_MAX_ORDER in AbstractFilterRegistrationBean and FilterRegistrationBean -> OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER.
## Configuration Property Changes
* spring.security.oauth2.client.registration.login.*.redirect-uri-template -> spring.security.oauth2.client.registration.login.*.redirect-uri
* spring.security.oauth2.resource.jwt.jwk.set-uri -> spring.security.oauth2.resourceserver.jwt.jwk-set-uri
* spring.cloud.enabled 속성이 제거되었습니다 (클라우드 커넥터를 비활성화해야하는 경우 CloudServiceConnectorsAutoConfiguration 로 제외).
* auto-configuration을 직접 제외하기 위해 모든 `management.metrics.binders. *. enabled` properties가 제거되었습니다.