Building spring cloud microservice framework: 1. Structure and various components

Time:2020-9-26

Build microservice framework (structure and components)


brief introduction

Building spring cloud microservice framework: 1. Structure and various components

Squid is based on spring, springboot, using the components under the spring cloud to build a set of microservice framework that can be developed and deployed quickly and can be used well.

Source address of this article: build microservice framework (structure and components)

GitHub address: Squid

assembly

  • [Spring-Cloud-Feign]()
  • [Spring-Security-OAuth]()
  • Spring-Cloud-Gateway
  • Spring-Cloud-Alibaba

middleware

  • [Redis]()
  • Nacos
  • Sentinel

Database persistence layer

  • [SpringDataJPA]()
  • Mybatis-Plus

database

  • Mysql5.7 +
  • Oracle

Environmental Science

  • JDK1.8
  • Maven3.2.5
  • Idea

If you have installed the above program on your computer, you can open GIT and enter the command[email protected]:yanzhenyidai/squid.gitClone this project to run locally.

However, you can also take a look at the description of the integration of the following components and send a link:

  • SC service registration and discovery
  • Read configuration information of Nacos
  • Service interface authentication
  • Service gateway processing
  • Database persistence layer – springdatajpa
  • [todo: database persistence layer mybatis plus] ()
  • [todo: Service fusing and tracking sentinel] ()

Project dependency

This project is inspring-boot: 2.0.9.RELEASEThe required documents are as follows:

   <parent>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-parent</artifactId>
       <version>2.0.9.RELEASE</version>
   </parent>
   
   <properties>
       <spring-cloud-alibaba.version>2.1.0.RELEASE</spring-cloud-alibaba.version>
       <spring-cloud-openfeign.version>2.2.0.RELEASE</spring-cloud-openfeign.version>
       <spring-cloud.version>Finchley.SR2</spring-cloud.version>
       <druid-starter.version>1.1.21</druid-starter.version>
   </properties>
   
   <dependencyManagement>
       <dependencies>
           <dependency>
               <groupId>com.alibaba</groupId>
               <artifactId>druid-spring-boot-starter</artifactId>
               <version>${druid-starter.version}</version>
           </dependency>

           <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>

           <dependency>
               <groupId>org.springframework.cloud</groupId>
               <artifactId>spring-cloud-dependencies</artifactId>
               <version>${spring-cloud.version}</version>
               <type>pom</type>
               <scope>import</scope>
           </dependency>

           <dependency>
               <groupId>org.springframework.cloud</groupId>
               <artifactId>spring-cloud-openfeign-dependencies</artifactId>
               <version>${spring-cloud-openfeign.version}</version>
               <type>pom</type>
               <scope>import</scope>
           </dependency>
       </dependencies>
   </dependencyManagement>

Parent withspringbootAt first, the reason is that springcloud is a set of scaffolding tools based on springboot. During the construction of this project, there are many version conflicts. Please take a look at the version arrangement of springboot and springcloud.

I hope it can help you.