中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

SpringBoot2.1升級2.2.x遷移方法

發布時間:2021-06-24 10:35:08 來源:億速云 閱讀:512 作者:chen 欄目:大數據

這篇文章主要講解了“SpringBoot2.1升級2.2.x遷移方法”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“SpringBoot2.1升級2.2.x遷移方法”吧!

1. MediaType.APPLICATION_JSON_UTF8_VALUE ===>>> MediaType.APPLICATION_JSON_VALUE

  • MediaType.APPLICATION_JSON_UTF8_VALUE 已被標記@Deprecated

  • 等效于{@link MediaType#APPLICATION_JSON_UTF8}的字符串。@deprecated自Spring Framework 5.2起不推薦使用,而推薦使用{@link #APPLICATION_JSON_VALUE}由于主要的瀏覽器(例如Chrome)現在已符合規范并正確解釋了UTF-8特殊字符 不需要{@code charset = UTF-8}參數。

2. org.springframework.data.domain.Sort 過時 新的替代方法: ????

  • 之前的寫法:Sort sort = new Sort(Sort.Direction.DESC, "taskId"); 如何替代?

  • 現在的寫法:Sort sort = Sort.by(Sort.Direction.DESC, "taskId"); 原因:private Sort(Direction direction, List<String> properties)是內部構造方法,不能在外部使用,外部使用Sort.by(Direction direction, List<String> properties);

3.Actuator HTTP Trace and Auditing are disabled by default 默認關閉 如何配置開啟

The Actuator HTTP Trace and Auditing features are not enabled by default anymore, since the default repositories implementations are in-memory and may consume too many resources and are not cluster friendly For robust, production-grade HTTP tracing we recommend the use of Spring Cloud Sleuth or similar.

To enable HTTP tracing, contribute a bean implementing HttpTraceRepository or AuditEventRepository to turn those features back on. Configuration properties are available to turn those features off even in the presence of those beans (see management.auditevents.enabled and management.trace.http.enabled)

4.Lazy initialization

  • It is now possible to enable global lazy initialization to reduce startup time via the spring.main.lazy-initialization property. Please note that using that feature comes at a cost:

Handling of HTTP requests may take longer while any deferred initialisation occurs

Failures that would normally occur at startup will now not occur until later

Individual beans can opt out of lazy initialization by annotating their definition with @Lazy(false). Where it is not possible to use @Lazy(false) to opt out of lazy initialization, a LazyInitializationExcludeFilter bean can be used instead. For example, to never set IntegrationFlow beans to lazy, you can use the following code:

@Bean static LazyInitializationExcludeFilter integrationLazyInitExcludeFilter() { return LazyInitializationExcludeFilter.forBeanTypes(IntegrationFlow.class); }

5.Reactor響應式編程事務支持的增強

Reactive Elasticsearch Auto-configuration

6.Spring Boot如何讓Web API自動生成文檔,并解決swagger-annotations的API注解description屬性廢棄的問題

  • https://blog.csdn.net/zhangchao19890805/article/details/54863338

  • 舊: @Api(description="歸檔")

  • 新: @Api(tags={"歸檔"})

JMX now disabled by default

  • As of #16090, JMX is not enabled by default anymore. This feature can be enabled with the configuration property spring.jmx.enabled=true. If you’re using IDE features to administer your applications, you may want to enable that flag there as well.

7.BlogServerApplication: Failed to retrieve application JMX service URL


8.@ConfigurationProperties scanning

Dependency Upgrades Spring Boot 2.2 moves to new versions of several Spring projects:

Reactor Dysprosium

Spring AMQP 2.2

Spring Batch 4.2

Spring Data Moore

Spring Framework 5.2

Spring HATEOAS 1.0

Spring Integration 5.2

Spring Kafka 2.3

Spring Security 5.2

Spring Session Corn

Numerous third-party dependencies have also been updated, some of the more noteworthy of which are the following:

Artemis 2.9

Elasticsearch 6.7

Flyway 6.0

Git Commit ID Plugin 3.0

Hazelcast 3.12

HSQLDB 2.5

Jackson 2.10

Jedis 3.1

Jersey 2.29

Kafka 2.3

Lettuce 5.2

Micrometer 1.3

Mockito 3.1

Solr 8.0

Miscellaneous Apart from the changes listed above, there have also been lots of minor tweaks and improvements including:

loadOnStartup can be configured if you’re wrapping a Servlet as an actuator endpoint.

Flyway bootstrap failures are covered by a dedicated FailureAnalyzer

The MessageConverter for Kafka batch listeners is properly auto-configured.

Add support for Jaybird 4 (jdbc:firebird prefix).

Add opt-in support for Neo4j-OGM native types.

Client-side HTTP-metrics have an outcome tag.

Numerous upgrades of third-party dependencies

Prometheus push gateway can now be configured using https

Printer and Parser beans are automatically registered with the application conversion service.

When using the H2 console auto-configuration, JDBC connection URL is now logged at startup for ease of connection.

Couchbase role-based access is now supported via spring.couchbase.username and spring.couchbase.password.

Support for OAuth3 resource server opaque token authentication has been added and can be configured using the spring.security.oauth3.resourceserver.opaquetoken configuration properties.

The application will fail fast if spring.config.location specifies a file with an extension that no PropertySourceLoader can read.

The layout to use to repackage the application can be set on the command line with Maven using the spring-boot.repackage.layout property.

RestTemplateBuilder#defaultHeader accepts more than one value.

Custom resource handlers can serve a favicon.

Kafka’s RecordInterceptor is detected and associated to the auto-configured listener container.

YAML configuration can now use on or off for boolean types.

Actuator discovery page is now available on / when using a separate management port.

@WebMvcTest now scans HandlerInterceptor beans.

@WebFluxTest scans WebFilter beans.

Configurable timeout for JMS listener container’s receive.

Support for Spring Session’s flush mode.

Support for Spring AMQP’s confirm-type.

Application properties for configuring Jetty’s thread pool.

Support for parallel test execution when using @AutoConfigureMockMvc with JUnit 5.

Zip64 files are now supported inside "Fat Jars".

The ROLLING_FILE_LOG_PATTERN is now exposed for use in logback configurations.

You can now inject and use a customized WebTestClient in any @SpringBootTest.

Dependency management for Oracle’s JDBC driver has been added.

Dependency management for Awaitility has been added.

Deprecations in Spring Boot 2.2 The logging.file property has been renamed to logging.file.name.

The logging.path property has been renamed to logging.file.path.

The server.connection-timeout property has been deprecated in favor of server-specific properties since their behaviors are not strictly the same.

The server.use-forward-headers property has been deprecated in favor of server.forward-headers-strategy; previously server.use-forward-headers=true would use the web server native support. You can now achieve the same with server.forward-headers-strategy=native. Because each server has a specific behavior, we now offer an alternative which relies on Spring’s ForwardedHeaderFilter: server.forward-headers-strategy=framework. Developers should use the option that fits best their use case.

ReactiveWebServerApplicationContext#getWebServerFactory.

The agent property of the Maven plugin has been renamed to agents.

Joda time support is deprecated in favour of java.time.

ApplicationHealthIndicator in favour of PingHealthIndicator that is always contributed.

ConfigurationBeanFactoryMetadata in favour of ConfigurationPropertiesBean.

ConfigurationPropertiesBindingPostProcessor constructors in favor of @EnableConfigurationProperties or the register method.

ConfigurationPropertiesBindingPostProcessor.VALIDATOR_BEAN_NAME has moved to EnableConfigurationProperties.VALIDATOR_BEAN_NAME.

ConfigurationPropertiesBindingPostProcessorRegistrar in favor of @EnableConfigurationProperties.

WebTestClientBuilderCustomizer has been relocated to org.springframework.boot.test.web.reactive.server.

參考

  • Spring-Boot-2.2-Release-Notes

感謝各位的閱讀,以上就是“SpringBoot2.1升級2.2.x遷移方法”的內容了,經過本文的學習后,相信大家對SpringBoot2.1升級2.2.x遷移方法這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

芜湖县| 万山特区| 长顺县| 乌什县| 彭阳县| 芒康县| 马山县| 黑龙江省| 资中县| 镇安县| 吴江市| 诸城市| 侯马市| 蛟河市| 恩平市| 金阳县| 剑川县| 眉山市| 鄢陵县| 民县| 常山县| 三明市| 克山县| 阳泉市| 辽阳市| 湟源县| 龙州县| 松原市| 通道| 凤阳县| 浪卡子县| 武城县| 元谋县| 长兴县| 博罗县| 琼中| 青田县| 京山县| 融水| 盐池县| 平凉市|