In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "which steps need to be configured in the early stage of learning SpringCloud". In daily operation, I believe that many people have doubts about what steps need to be configured in the early stage of learning SpringCloud. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "which steps need to be configured in the early stage of learning SpringCloud". Next, please follow the editor to study!
Preface
Before writing this series of articles, I feel it is necessary to elaborate on what Spring Cloud is. Unlike Spring (Spring Framework), it is generally understood that it is a container that manages bean. Do not want SpringBoot, it can be understood that it is an enhanced version of Spring, integrated with SSM and other frameworks, and a large number of support and recommended annotation development.
But for Spring Cloud, it is a framework of micro-services architecture, it is not a single project, it is the integration of multiple projects. In other words, if you want to learn Spring Cloud, you are actually learning more than one project about microservices.
The so-called micro-service is to split the original one-stop business into a specific module, each module does only one thing, and then derives a unified management of these services modules, as well as service protection measures and other modules. It boils down to five cores, service discovery (registration), load balancing, circuit breaker, service gateway and distributed configuration.
How to set up a module
A few weeks ago, when I wanted to build a module, I might choose to use Spring Initializer to create it, but recently I feel more comfortable to build a new module directly. Everyone's habits are different, how comfortable they are.
Here's how to create a module using maven
You can change the module name to create the desired module, which has the advantage of integrating the imported dependencies in the parent module, which is much easier than Spring Initializer, which requires manual configuration of the module's parent-child relationship (or a partner who knows how to do it can also leave a message).
Preparation in advance
In order to learn better, we first set up a general project, which also uses maven to build a project, and the structure after the establishment is as follows
The next thing to do is to delete the entire src directory, because it is not needed later, and the second is to modify the pom file.
4.0.0 com.cutey.none springcloud-demo pom 1.0-SNAPSHOT 8 8 org.springframework.boot spring-boot-starter-web 2.3.0.RELEASE org. Springframework.boot spring-boot-dependencies 2.3.0.RELEASE pom import org.springframework.cloud spring-cloud-dependencies Hoxton.SR11 pom import
Everyone needs to modify the groupId and artifactId in lines 7 and 8. This allows you to declare the dependencies that must be used in the root module, that is, the pom file. For example, the above spring-boot-starter-web has an entire dependency in all submodules.
Even if you are lazy enough, you can write all the dependencies in the parent module so that you can ignore the pom file during the subsequent creation of the child module.
At this point, the study of "which steps need to be configured in the early stages of learning SpringCloud" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.