Spring Boot 2.0 (a): "Heavyweight" Spring Boot 2.0 authoritative release

Source: Internet
Author: User
Tags oauth

Just yesterday Spring Boot 2.0.0.RELEASEOfficially released, this morning in the release of Spring Boot2.0 in a small episode, the spring Boot2.0 sync to the Maven warehouse when there was an error, and then spring boot officials quickly released on GitHub The V2.0.0.release version was withdrawn. In the afternoon to fix the problem, and re-uploaded, so spring Boot2.0 officially launched!

Be aware that this is the first major revision of the spring Boot1.0 Release 4, so there are many new features and features that you should expect! In the Spring Boot official blog, we learned that the spring Boot2.0 version went through 17 months of development, with 215 different users offering more than 6,800 submissions, and expressed great appreciation for each user who contributed And all early adopters who provide important feedback on these milestone releases.

The technical people familiar with spring Boot/cloud know that spring boot relies on spring, and Spring cloud relies on spring boot, so spring BOOT2.0 's release formally integrates many of the features of Spring5.0, and the latest releases of spring cloud will also need to incorporate the latest spring Boot2.0 content.

New version Features

Highlights of the new release are:

Java 8-based, Java 9 supported

That is to say, Spring Boot2.0 minimum version requirements for JDK8, it is understood that most of the domestic Internet company systems are still running on the JDK1.6/7, so want to upgrade to spring Boot2.0 students attention, while supporting the JAVA9, but only support.

Responsive programming

Using Spring Webflux/webflux.fn to provide responsive web programming support, Webflux is a new, non-clogging, functional reactive WEB framework that can be used to build asynchronous, non-clogging, event-driven services that perform very well in terms of scalability. This feature is derived from Spring5.0.

Spring Boot2.0 also provides automated configuration of responsive programming, such as reactive spring Data, Reactive spring Security, and more

HTTP/2 Support

Supported in Tomcat, Undertow and Jetty HTTP/2

Support for Kotlin

Introduces support for Kotlin 1.2.x and provides a runapplication function that lets you run the Spring Boot application with the usual Kotlin.

A new actuator architecture

New actuator architecture that supports Spring MVC, Webflux and Jersey

Support Quartz

Spring Boot1.0 does not provide support for Quartz, and there are a variety of integration scenarios, and the spring Boot2.0 provides the simplest way to integrate.

Security

Greatly simplifies security auto-configuration

Metrics

Metrics, Spring Boot 2 introduces micrometer to unify the metrics specification, allowing developers to better understand and use metrics modules without having to worry about the exact storage of the docking.

Monitoring aspects

Spring Boot 2 enhances the integration of micrometer. RabbitMQ, JVM threads, and garbage collection metrics are automatically instrument monitored, and the asynchronous controller is automatically added to the monitor. The InfluxDB server can also be monitored through integration.

Data aspects

    • DB, the default introduction of HIKARICP, instead of the previous tomcat-pool as the underlying database connection pool, compared to Tomcat-pool, HIKARICP has better performance, in short, improve the DB access speed
    • Jooq's support
    • For Redis, lettuce is introduced by default, replacing the previous Jedis as the underlying Redis link
    • Mongodb\hibernate optimization

Thymeleaf 3

Spring Boot 2 supports Thymeleaf 3,thymeleaf 3 compared to Thymeleaf 2 performance boost is not a little bit, because the performance of 2.0 is really not well, but also the use of a new page parsing system.

OAuth 2.0

It also adds support for OAuth 2.0, which allows developers to use spring-security to complete the development of permission modules.

Updates for dependent components

    • Jetty 9.4
    • Tomcat 8.5
    • Flyway 5
    • Hibernate 5.2
    • Gradle 3.4
    • Thymeleaf 3. 0

Finally, there is a small egg, Spring Boot2.0 support the animated GIF start logo printing.

Explanation of technical terms

Spring is now the boss of the Java Open Source industry, its every move has affected the industry's technical direction, in this release notes found a lot of technology has not been learned, but also share:

What is Webflux?

The name of the Webflux module is Spring-webflux, and flux in the name is derived from the class flux in Reactor. Spring Webflux has a new, non-clogging, functional reactive WEB framework that can be used to build asynchronous, non-clogging, event-driven services that perform very well in terms of scalability.

The key expected benefit of non-blocking is the ability to scale with a small, fixed number of threads and less memory. The server-side Webflux supports 2 different programming models:

    • Annotation-based @Controller and other annotations also support Spring MVC
    • Functional, Java 8 lambda-style Routing and processing

By default, Spring Boot 2 uses Netty Webflux because Netty is widely used in asynchronous nonblocking space, and asynchronous nonblocking connections can save more resources and provide higher responsiveness. By comparing Servlet 3.1 non-blocking I/O is not much used, because the cost of using it is relatively high, Spring Webflux opens up a practical path.

It is noteworthy that the database supporting reactive programming is only MongoDB, Redis, Cassandra, couchbase

Http/2

Compared to the HTTP/1.X,HTTP/2 at the bottom of the transmission made a lot of changes and optimizations:

    • HTTP/2 uses binary format to transfer data, not http/1.x text format. Binary format brings more advantages and possibilities in protocol parsing and optimization expansion.
    • HTTP/2 uses HPACK to compress the message header, which can save the traffic of the network that the message header occupies. and http/1.x each request, will carry a large number of redundant head information, wasting a lot of bandwidth resources. Header compression is a good solution to this problem.
    • Multiplexing, to put it bluntly, is that all requests are done concurrently through a TCP connection. http/1.x Although the pipeline can also be requested concurrently, but the response between multiple requests will be blocked, so pipeline has not been widely used, and HTTP/2 to achieve real concurrent requests. At the same time, the stream also supports priority and flow control.
    • Server push: The service side can push resources to the client faster. For example, the server can actively push JS and CSS files to the client, without the need for the client to parse HTML and send these requests. When the client needs it, it is already on the client.

Jooq

Jooq is a toolkit for Java-based access to relational databases. Jooq not only absorbs the simplicity and security of the traditional ORM operation data, but also retains the flexibility of native SQL, which is more like the middle tier between Orms and JDBC. For the code farmer who likes to write SQL, Jooq can fully satisfy your control, and can be written in Java code to write the feeling of SQL.

Lettuce

Lettuce is a scalable, thread-safe Redis Client for synchronous, asynchronous, and reactive use. Multiple threads can share the same redisconnection. It leverages the excellent Netty NIO framework to effectively manage multiple connections. Supports advanced Redis features such as Sentinel, Cluster, pipelining, auto reconnect and Redis data model.

The majority of domestic use of Jedis, it seems to be more research and research lettuce.

Hikaricp

The HIKARICP is a high-performance JDBC Connection pool. Hikari is the meaning of Japanese "light". May be the fastest database connection pool in the Java industry today.

Flyway

Flyway is a database versioning tool that is independent of database applications, manages, and tracks database changes. In layman's words, flyway can manage different people's SQL scripts like SVN manages different people's code, thus doing database synchronization.

Gson

Gson is an open source framework for Google parsing JSON, similar frameworks Fastjson,jackjson and so on

After reading Spring Boot 2.0 Release Notes, there are a lot of new technologies that we don't know about, and some of them have learned

Choose whether to upgrade

As you can see from the above, spring Boot2.0 has added a lot of new features to the 1.0, and most importantly, the minimum version of the JDK that spring Boot2.0 relies on is 1.8, and it is estimated that most Internet companies in the country are still so aggressive. Another new major version of the update, there will inevitably be some small bugs or something, often need to release a few smaller versions, will slowly stabilize.

So my advice is that if you're not particularly interested in using the new features mentioned in spring Boot2.0, try not to rush to upgrade, and then use it when spring Boot2.0 is completely stabilized. If you want to upgrade and then upgrade to the spring boot1.5x series from an earlier version to the spring Boot2.0 version, many of the configuration content of Spring Boot2.0 and the spring Boot1.0 inconsistencies need to be noted.

Spring Boot1.0 released a new development model, Spring Boot2.0 release marks the spring boot has matured, the changes to the Java community has been opened!

Written in the last

Two days before watching Chi Jianqiang teacher article, found that the teacher just also introduced Spring Boot2.0, which has such a view: Why the Java language can occupy the first place in the ranking of programming weapons in the long term? Because of the good life.

Java can be prosperous, mainly the good life. Whenever people feel that Java is out of time, there will always be heroes to save the United States.

When Java was originally developed and did not know what to use, it was found that it was possible to animate the Web page with applets. Later, enterprise-level software development ERA Java EE Big line, open source Community Spring Peach all over the world. When the mobile era, people feel that Java is finished, Google to bail out the bailout, the acquisition and opening of the Android platform, the language is Java, so Java again rejuvenated. In the Big data field, Java is also the right player.

The spring Framework is now used for more than 10 years, and spring Boot was born when everyone was tortured by a thousands of-line ApplicationContext profile. What is Spring Boot? Used to simplify the development of Spring applications.

In other words, when you think Java is not working, I made a lightweight S, so you use Java well. When you feel the S is not light enough, I made a SB, make you think S is still very light.

From 2002 Rod Johnson interface21 to today Spring Boot2.0 , Spring has gone through 16 years of spring and autumn, has experienced more than n contributors, spring also from a small open source framework, the development of the Java field is one of the most successful open source software! At the same time as a Java development practitioners, but also special thanks to spring, such as open source organizations, to promote enterprise-level development has made a huge contribution, the world's Java developers are its beneficiaries!

Salute to spring and salute to open source!

Click I know more Spring Boot series articles

Reference

Spring Boot 2.0 Release Notes
Spring Boot 2.0 Goes GA
? Spring Boot 2.0 sync to Maven repository error, recalled ...

Spring Boot 2.0 (a): "Heavyweight" Spring Boot 2.0 authoritative release

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.