mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Merge pull request #597 from mercyblitz/master
[Update] Dubbo Spring Cloud Samples
This commit is contained in:
commit
f2a0b41151
@ -36,71 +36,51 @@
|
|||||||
<curator.version>4.0.1</curator.version>
|
<curator.version>4.0.1</curator.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<dependencyManagement>
|
||||||
|
|
||||||
<profile>
|
|
||||||
<id>eureka</id>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Eureka Service Discovery -->
|
<!-- Spring Boot dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Cloud Alibaba dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-netflix</artifactId>
|
||||||
<version>${spring-cloud-netflix.version}</version>
|
<version>${spring-cloud-netflix.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<!-- Zookeeper -->
|
|
||||||
<profile>
|
|
||||||
<id>zookeeper</id>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Zookeeper Service Discovery -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
<artifactId>spring-cloud-openfeign-dependencies</artifactId>
|
||||||
<version>${spring-cloud-zookeeper.version}</version>
|
<version>${spring-cloud-openfeign.version}</version>
|
||||||
<exclusions>
|
<type>pom</type>
|
||||||
<exclusion>
|
<scope>import</scope>
|
||||||
<groupId>org.apache.zookeeper</groupId>
|
|
||||||
<artifactId>zookeeper</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.zookeeper</groupId>
|
<groupId>org.apache.dubbo</groupId>
|
||||||
<artifactId>zookeeper</artifactId>
|
<artifactId>dubbo-bom</artifactId>
|
||||||
<version>3.4.12</version>
|
<version>${dubbo.version}</version>
|
||||||
<optional>true</optional>
|
<type>pom</type>
|
||||||
<exclusions>
|
<scope>import</scope>
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.curator</groupId>
|
|
||||||
<artifactId>curator-framework</artifactId>
|
|
||||||
<version>${curator.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</profile>
|
</dependencyManagement>
|
||||||
|
|
||||||
<profile>
|
|
||||||
<id>consul</id>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Spring Cloud Consul -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
|
||||||
<version>${spring-cloud-consul.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
dubbo:
|
dubbo:
|
||||||
registry:
|
registry:
|
||||||
# 挂载到 Spring Cloud 注册中心
|
|
||||||
address: spring-cloud://localhost
|
address: spring-cloud://localhost
|
||||||
cloud:
|
cloud:
|
||||||
subscribed-services: spring-cloud-alibaba-dubbo-server
|
subscribed-services: spring-cloud-alibaba-dubbo-server
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# Dubbo 应用名称
|
|
||||||
name: spring-cloud-alibaba-dubbo-client
|
name: spring-cloud-alibaba-dubbo-client
|
||||||
main:
|
main:
|
||||||
# Spring Boot 2.1 需要设定
|
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
# Nacos 服务发现与注册配置
|
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
@ -14,35 +14,6 @@
|
|||||||
<artifactId>spring-cloud-dubbo-consumer-sample</artifactId>
|
<artifactId>spring-cloud-dubbo-consumer-sample</artifactId>
|
||||||
<name>Spring Cloud Dubbo Consumer Sample</name>
|
<name>Spring Cloud Dubbo Consumer Sample</name>
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Spring Cloud Alibaba dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-netflix</artifactId>
|
|
||||||
<version>${spring-cloud-netflix.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>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -80,11 +51,58 @@
|
|||||||
<artifactId>spring-cloud-starter-dubbo</artifactId>
|
<artifactId>spring-cloud-starter-dubbo</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- List all Spring Cloud starters for Service Discovery -->
|
||||||
|
|
||||||
<!-- Spring Cloud Nacos Service Discovery -->
|
<!-- Spring Cloud Nacos Service Discovery -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Eureka Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Zookeeper Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
||||||
|
<version>${spring-cloud-zookeeper.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
|
<artifactId>zookeeper</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
|
<artifactId>zookeeper</artifactId>
|
||||||
|
<version>3.4.12</version>
|
||||||
|
<optional>true</optional>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.curator</groupId>
|
||||||
|
<artifactId>curator-framework</artifactId>
|
||||||
|
<version>${curator.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Cloud Consul Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
|
<version>${spring-cloud-consul.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -14,36 +14,6 @@
|
|||||||
<artifactId>spring-cloud-dubbo-provider-sample</artifactId>
|
<artifactId>spring-cloud-dubbo-provider-sample</artifactId>
|
||||||
<name>Spring Cloud Dubbo Provider Sample</name>
|
<name>Spring Cloud Dubbo Provider Sample</name>
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Spring Boot dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
|
||||||
<version>${spring-boot.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Spring Cloud Alibaba dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.dubbo</groupId>
|
|
||||||
<artifactId>dubbo-bom</artifactId>
|
|
||||||
<version>${dubbo.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- Resolve the Dubbo REST RPC issue -->
|
<!-- Resolve the Dubbo REST RPC issue -->
|
||||||
@ -78,12 +48,59 @@
|
|||||||
<artifactId>spring-cloud-starter-dubbo</artifactId>
|
<artifactId>spring-cloud-starter-dubbo</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- List all Spring Cloud starters for Service Discovery -->
|
||||||
|
|
||||||
<!-- Spring Cloud Nacos Service Discovery -->
|
<!-- Spring Cloud Nacos Service Discovery -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Eureka Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Zookeeper Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
||||||
|
<version>${spring-cloud-zookeeper.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
|
<artifactId>zookeeper</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
|
<artifactId>zookeeper</artifactId>
|
||||||
|
<version>3.4.12</version>
|
||||||
|
<optional>true</optional>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.curator</groupId>
|
||||||
|
<artifactId>curator-framework</artifactId>
|
||||||
|
<version>${curator.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Cloud Consul Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
|
<version>${spring-cloud-consul.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- REST support dependencies -->
|
<!-- REST support dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
|
@ -14,19 +14,6 @@
|
|||||||
<artifactId>spring-cloud-dubbo-provider-web-sample</artifactId>
|
<artifactId>spring-cloud-dubbo-provider-web-sample</artifactId>
|
||||||
<name>Spring Cloud Dubbo Provider Web Sample</name>
|
<name>Spring Cloud Dubbo Provider Web Sample</name>
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Spring Cloud Alibaba dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- Production Ready features -->
|
<!-- Production Ready features -->
|
||||||
@ -53,11 +40,60 @@
|
|||||||
<artifactId>spring-cloud-starter-dubbo</artifactId>
|
<artifactId>spring-cloud-starter-dubbo</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- List all Spring Cloud starters for Service Discovery -->
|
||||||
|
|
||||||
<!-- Spring Cloud Nacos Service Discovery -->
|
<!-- Spring Cloud Nacos Service Discovery -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Eureka Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Zookeeper Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
|
||||||
|
<version>${spring-cloud-zookeeper.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
|
<artifactId>zookeeper</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.zookeeper</groupId>
|
||||||
|
<artifactId>zookeeper</artifactId>
|
||||||
|
<version>3.4.12</version>
|
||||||
|
<optional>true</optional>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.curator</groupId>
|
||||||
|
<artifactId>curator-framework</artifactId>
|
||||||
|
<version>${curator.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Cloud Consul Service Discovery -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
|
<version>${spring-cloud-consul.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
dubbo:
|
dubbo:
|
||||||
scan:
|
scan:
|
||||||
# dubbo 服务扫描基准包
|
|
||||||
base-packages: org.springframework.cloud.alibaba.dubbo.bootstrap
|
base-packages: org.springframework.cloud.alibaba.dubbo.bootstrap
|
||||||
protocol:
|
protocol:
|
||||||
# dubbo 协议
|
|
||||||
name: dubbo
|
name: dubbo
|
||||||
# dubbo 协议端口( -1 表示自增端口)
|
|
||||||
port: -1
|
port: -1
|
||||||
registry:
|
registry:
|
||||||
# 挂载到 Spring Cloud 注册中心
|
|
||||||
address: spring-cloud://localhost
|
address: spring-cloud://localhost
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# Dubbo 应用名称
|
|
||||||
name: spring-cloud-alibaba-dubbo-server
|
name: spring-cloud-alibaba-dubbo-server
|
||||||
main:
|
main:
|
||||||
# Spring Boot 2.1 需要设定
|
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
# Nacos 服务发现与注册配置
|
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
@ -14,27 +14,6 @@
|
|||||||
<artifactId>spring-cloud-dubbo-servlet-gateway-sample</artifactId>
|
<artifactId>spring-cloud-dubbo-servlet-gateway-sample</artifactId>
|
||||||
<name>Spring Cloud Dubbo Servlet Gateway Sample</name>
|
<name>Spring Cloud Dubbo Servlet Gateway Sample</name>
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<!-- Spring Cloud Alibaba dependencies -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
|
||||||
<version>${project.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>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user