- Spring Microservices
- Rajesh RV
- 290字
- 2021-07-02 16:28:29
Using Spring Boot to build RESTful microservices
Spring Boot is a utility framework from the Spring team to bootstrap Spring-based applications and microservices quickly and easily. The framework uses an opinionated approach over configurations for decision making, thereby reducing the effort required in writing a lot of boilerplate code and configurations. Using the 80-20 principle, developers should be able to kickstart a variety of Spring applications with many default values. Spring Boot further presents opportunities for the developers to customize applications by overriding the autoconfigured values.
Spring Boot not only increases the speed of development but also provides a set of production-ready ops features such as health checks and metrics collection. As Spring Boot masks many configuration parameters and abstracts many lower-level implementations, it minimizes the chance of error to a certain extent. Spring Boot recognizes the nature of the application based on the libraries available in the class path and runs the autoconfiguration classes packaged in these libraries.
Often, many developers mistakenly see Spring Boot as a code generator, but in reality, it is not. Spring Boot only autoconfigures build files—for example, POM files in the case of Maven. It also sets properties, such as data source properties, based on certain opinionated defaults. Take a look at the following code:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <scope>runtime</scope> </dependency>
For instance, in the preceding case, Spring Boot understands that the project is set to use the Spring Data JPA and HSQL databases. It automatically configures the driver class and other connection parameters.
One of the great outcomes of Spring Boot is that it almost eliminates the need to have traditional XML configurations. Spring Boot also enables microservices' development by packaging all the required runtime dependencies in a fat executable JAR file.
- Python概率統(tǒng)計(jì)
- Design Principles for Process:driven Architectures Using Oracle BPM and SOA Suite 12c
- The Modern C++ Challenge
- Cocos2d-x游戲開發(fā):手把手教你Lua語言的編程方法
- Android 應(yīng)用案例開發(fā)大全(第3版)
- 青少年P(guān)ython編程入門
- HTML5+CSS3網(wǎng)頁設(shè)計(jì)
- UML 基礎(chǔ)與 Rose 建模案例(第3版)
- Swift語言實(shí)戰(zhàn)精講
- C++面向?qū)ο蟪绦蛟O(shè)計(jì)習(xí)題解答與上機(jī)指導(dǎo)(第三版)
- C# and .NET Core Test Driven Development
- Learning Python Data Visualization
- 會當(dāng)凌絕頂:Java開發(fā)修行實(shí)錄
- Drupal Search Engine Optimization
- Elasticsearch搜索引擎構(gòu)建入門與實(shí)戰(zhàn)