- Mastering Microservices with Java
- Sourabh Sharma
- 386字
- 2021-07-02 13:03:31
Spring Boot
Spring Boot is an obvious choice for developing state-of-the-art, production-ready applications specific to Spring. Its website (https://projects.spring.io/spring-boot/) also states its real advantages
Spring Boot is an amazing Spring tool created by Pivotal that was released in April 2014 (GA). It was developed based on the request of SPR-9888 (https://jira.spring.io/browse/SPR-9888) with the title, Improved support for 'containerless' web application architectures.
You must be wondering: Why containerless? Because, today's cloud environment, or PaaS, provides most of the features offered by container-based web architectures, such as reliability, management, or scaling. Therefore, Spring Boot focuses on making itself an ultralight container.
Spring Boot is preconfigured to make production-ready web applications very easily. Spring Initializr (http://start.spring.io) is a page where you can select build tools, such as Maven or Gradle, along with project metadata, such as group, artifact, and dependencies. Once you feed the required fields, you can just click on the Generate Project button, which will give you the Spring Boot project that you can use for your production application.
On this page, the default Packaging option is Jar. We'll also use JAR packaging for our microservices development. The reason is very simple: it makes microservices development easier. Just think how difficult it would be to manage and create an infrastructure where each microservice runs on its own server instance.
Josh Long shared the following in his talk on one of the Spring IOs:
Later, we will use Spring Cloud, which is a wrapper on top of Spring Boot.
We will develop a sample REST application that will use the Java 9 module feature. We will create two modules—lib and rest. The lib module will provide the models or any supported classes to the rest module. The rest module will include all the classes that are required to develop the REST application and it will also consume the model classes defined in the lib module.
Both the lib and rest modules are maven modules, and their parent module is our main project, 6392_chapter2.
The module-info.java file is an important class that governs the access of its classes. We'll make use of requires, opens, and exports to use the spring modules and establish the provider-consumer relationship between the lib and rest modules of our REST application.
- 深入淺出Electron:原理、工程與實踐
- Java Web及其框架技術
- Getting Started with PowerShell
- Web全棧工程師的自我修養
- Java程序設計與實踐教程(第2版)
- SAS數據統計分析與編程實踐
- MySQL數據庫基礎實例教程(微課版)
- SQL Server 2016數據庫應用與開發
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- Extending Unity with Editor Scripting
- Machine Learning for OpenCV
- Go語言入門經典
- Java從入門到精通(視頻實戰版)
- jQuery Mobile Web Development Essentials(Second Edition)
- Keil Cx51 V7.0單片機高級語言編程與μVision2應用實踐