Spring cloud+spring Boot Self-study 01

Source: Internet
Author: User

"", "the main content: Spring cloud+spring boot first knowledge and spring boot environment construction

"" "", Welcome to correct, send your questions to discuss together!


Brief introduction:
Spring Cloud:
Spring Cloud is a development tool for microservices architectures based on the spring boot implementation. It is a bit of configuration management that is involved in the micro-service architecture,
Service governance, circuit breakers, intelligent routing, micro-proxies, control buses, global locks, decision campaigns, distributed sessions, and cluster status
Management and other operations provide a simple way to develop.

Sring Boot:
Spring Boot is a development framework for microservices. It is easy and easy to integrate spring cloud for system service.
  

It is seen from the introduction description that the rapid development of the SPRINGBOOT framework should be studied before learning Springcloud.

Spring Boot Learning:
Advantages:
Automate configuration, rapid development, and ease of deployment.
My understanding:
1. Embedded Web Service Program (JAR), which integrates the regular dependency and XML file configuration in our development, simplifies our configuration
2, because the automation configuration in 1 allows us to directly create the Springboot project, run directly to enable, and start rapid development.
3, inherit and carry forward the spring annotation advantages, so that we can be more flexible and simple development.
The framework can also be configured quickly by annotations.

Spring Boot Environment setup (two ways)
Way One:
Create a spring boot project directly from eclipse
1. Clipse Install STS (Spring Tool Suite) Plugin
Open eclipse,help->eclipse marketplace-> Select popular-> Select sts->installed, download the plugin to wait a while.
The basic operating environment is built successfully, and now you can build a spring boot project. Because Eclipse provides a spring Tool Suite (STS) plug-in,
Using plug-ins can be developed more quickly.
2. After the download is complete, you can see the spring directory in New->project and select Spring Starter project->next

    

  

Successfully configured the environment.
Way two:
Configure the dependency build environment yourself in Pom.xml through the MAVEN project
1. Create a jar-type Maven project.
2, the import springboot coordinate dependence

1      <Parent>2         <groupId>Org.springframework.boot</groupId>3         <Artifactid>Spring-boot-starter-parent</Artifactid>4         <version>1.5.9.RELEASE</version>5         <RelativePath/> <!--Lookup parent from repository -6     </Parent>7 8     <Properties>9         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>Ten         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> One         <java.version>1.8</java.version> A     </Properties> -  -     <Dependencies> the         <Dependency> -             <groupId>Org.springframework.boot</groupId> -             <Artifactid>Spring-boot-starter-web</Artifactid> -         </Dependency> +  -         <Dependency> +             <groupId>Org.springframework.boot</groupId> A             <Artifactid>Spring-boot-starter-test</Artifactid> at             <Scope>Test</Scope> -         </Dependency> -     </Dependencies> -  -     <Build> -         <Plugins> in             <plugin> -                 <groupId>Org.springframework.boot</groupId> to                 <Artifactid>Spring-boot-maven-plugin</Artifactid> +             </plugin> -         </Plugins> the     </Build>

3. Create under Src/main/resources

4. Create under Src/main/main

  

5, like the way one right button run as-"execution test appears the same screen indicates success

Error in configuration:

Because the Pom.xml file that is copied from the Web may have an error (possibly due to an error in the update), it takes time to resolve and the first method is recommended.

Spring cloud+spring Boot Self-study 01

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.