Spring cloud Alibaba (I) -- environment construction
Introduction to spring cloud Alibaba
springcloud
The spring team has an open source microservice tool set to help us quickly build distributed systems (microservice systems) and provide netflix for spring organizations
springcloud alibaba
The open source microservice toolset of alibaba team helps us quickly build distributed systems (microservice systems) and provide alibaba solutions
springcloud alibaba is a one-stop solution provided by alicloud for distributed application development. It contains all the components needed to develop distributed applications, making it easy for you to develop applications using spring cloud.
With Alibaba cloud, you only need to add some annotations and a few configurations to connect Spring cloud applications to Alibaba's distributed solutions and build a distributed application system with Alibaba middleware.
spring cloud alibaba features
technical support | springcloud alibaba | springcloud netflix |
---|---|---|
Service degradation and flow control | sentinel | hystrix |
Service registration and discovery | nacos | eureka ,consul |
Distributed configuration & event driven message bus | nacos | config & bus |
Distributed transaction & Dubbo | seta |
Spring cloud component
technical support | springcloud alibaba | springcloud netflix |
---|---|---|
Service registration and discovery component | nacos | eureka consul |
Inter service communication component | restTemplate+ribbon,Openfeign | restTemplate+ribbon,Openfeign |
Service degradation and fusing | sentinel | hystrix hystrix dashboard |
Service gateway component | gateway | gateway |
Unified configuration center message bus component | nacos | config bus |
Actual development of microservice project springcloud netfilx + springcloud alibaba +springcloud spring
Five component selection
- 1. Service registry = = = = > Nacos (Alibaba)
- 2. Load balancing between service communications = = = = = = > resttemplate + ribbon (Netflix) or Openfeign (Spring)
- 3. Service fusing and service degradation = = = = = > sentinel (Alibaba)
- 4. Service gateway component = = = = > gateway (spring)
- 5. Unified configuration center component = = = = > Nacos (Alibaba)
Build spring cloud Alibaba environment
1. Create a new empty project
2. Create a new module in an empty project
3. Add dependent
<!--inherit springboot Parent project--> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.5.RELEASE</version> </parent> <!--Jiaqun 1025684353 blowing water and chatting together--> <!--Define version number--> <properties> <spring.cloud.version>Hoxton.SR6</spring.cloud.version> <spring.cloud.alibaba.version>2.2.1.RELEASE</spring.cloud.alibaba.version> </properties> <!--Maintenance dependency--> <dependencyManagement> <dependencies> <!--maintain springcloud--> <!--Jiaqun 1025684353 blowing water and chatting together--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring.cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> <!--maintain springcloud alibaba--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>${spring.cloud.alibaba.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>