August 2019 grew 10 title

1. Comparison of spring cloud and dubbo, what are their advantages and disadvantages

dubbo because it is binary transmission, bandwidth will be less

springCloud is http transmission protocol, the bandwidth will be more while using the http protocol typically use JSON messages, consumption will be greater

dubbo of development more difficult, because the jar package dependencies dubbo many large projects can not be solved

springcloud interface agreement relatively free and loose, it requires strong administrative measures to restrict the interface disorderly upgrade

dubbo registries can choose a variety zk, redis, etc., registry springcloud can only be used eureka or self-study
differences 2.spring cloud and spring boot of

SpringBoot focus on quick and easy development of a single individual micro-services.

SpringCloud micro coordination of services finishing governance framework of global concern, it SpringBoot development of a monomer integrate and manage micro services,

Between the various service providers, configuration management, service discovery, circuit breakers, routing, micro broker, event bus, global lock, selection decisions, such as distributed session integration services.

SpringBoot can leave SpringCloud independent development projects, but can not do without SpringBoot SpringCloud, belongs to the dependencies.

SpringBoot focus on quick and easy development of a single micro-serving individuals, SpringCloud attention to service global governance framework.

3. How springboot services into spring cloud

A: pom.xml add the following code

<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Edgware.RELEASE</spring-cloud.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<the artifactId> Starter-Spring-Cloud-Zipkin </ the artifactId>
</ dependency>
</ Dependencies>
two: yml profile by adding the following configuration

server:
port: 8080
spring:
application:
name: mcp-auth
profiles:
active: dev
cloud:
config:
fail-fast: false
discovery:
service-id: mcp-config-server
enabled: true
profile: ${spring.profiles.active}
label: master
---
spring:
profiles: dev
eureka:
instance:
prefer-ip-address: true
lease-renewal-interval-in-seconds: 5
lease-expiration-duration-in-seconds: 20
client:
serviceUrl:
defaultZone: http://mcp:[email protected]:1025/eureka
registry-fetch-interval-seconds: 10
---
spring:
zipkin:
base-url: http://172.16.17.130:7001
sleuth:
sampler:
percentage: 1.0
---
spring:
rabbitmq:
host: 172.16.17.130
port: 5672
username: guest
password: guest
---
mybatis:
mapper-locations: classpath:mybatis/mapper/*.xml
config-locations: classpath:mybatis/mybatis-config.xml
type-aliases-package: com.bonc.ioc.sso.model

spring:
datasource:
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://ip:31169/ioc_omp?useUnicode=true&characterEncoding=utf-8
username: ioccp_kf
password: ioccp_kf

 

Guess you like

Origin www.cnblogs.com/whymoney1000/p/11332751.html