- Mastering Microservices with Java 9(Second Edition)
- Sourabh Sharma
- 360字
- 2021-07-02 21:54:44
Spring Boot overview
Spring Boot is an amazing Spring tool created by Pivotal and it 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</span>) is a page where you can select build tools such as Maven or Gradle, and 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 in his talk in one of the Spring IOs:
"It is better to make Jar, not War."
Later, we will use Spring Cloud, which is a wrapper on top of Spring Boot.
We would develop a sample REST application that would 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.
- C及C++程序設(shè)計(jì)(第4版)
- 精通Nginx(第2版)
- SOA實(shí)踐
- Processing互動(dòng)編程藝術(shù)
- Visual Basic程序設(shè)計(jì)教程
- 深度強(qiáng)化學(xué)習(xí)算法與實(shí)踐:基于PyTorch的實(shí)現(xiàn)
- Learning Raspbian
- Web Development with MongoDB and Node(Third Edition)
- Java EE核心技術(shù)與應(yīng)用
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)實(shí)踐教程
- UI設(shè)計(jì)全書(全彩)
- Python入門很輕松(微課超值版)
- Shopify Application Development
- R語言實(shí)戰(zhàn)(第2版)
- Node.js實(shí)戰(zhàn):分布式系統(tǒng)中的后端服務(wù)開發(fā)