Skip to content

Commit 3f42880

Browse files
committed
Simplify cloud examples into a single project
1 parent b5a155c commit 3f42880

File tree

39 files changed

+159
-798
lines changed

39 files changed

+159
-798
lines changed

examples/cloud-grpc-client-consul/build.gradle

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/cloud-grpc-client-consul/src/main/java/net/devh/boot/grpc/examples/cloud/client/GrpcClientController.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

examples/cloud-grpc-client-consul/src/main/java/net/devh/boot/grpc/examples/cloud/client/GrpcClientService.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

examples/cloud-grpc-client-consul/src/main/resources/application.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/cloud-grpc-client-zookeeper/build.gradle

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/cloud-grpc-client-zookeeper/src/main/java/net/devh/boot/grpc/examples/cloud/client/GrpcClientController.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

examples/cloud-grpc-client-zookeeper/src/main/java/net/devh/boot/grpc/examples/cloud/client/GrpcClientService.java

Lines changed: 0 additions & 50 deletions
This file was deleted.

examples/cloud-grpc-client-zookeeper/src/main/java/net/devh/boot/grpc/examples/cloud/client/ZookeeperClientApplication.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

examples/cloud-grpc-client-zookeeper/src/main/resources/application.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/cloud-grpc-client/build.gradle

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,36 @@ plugins {
22
id 'org.springframework.boot'
33
}
44

5+
def discoveryProvider = project.findProperty('discovery') ?: 'consul';
6+
57
dependencies {
6-
implementation 'org.springframework.boot:spring-boot-starter-web'
7-
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
8+
switch (discoveryProvider) {
9+
case "nacos": {
10+
implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
11+
break;
12+
}
13+
case "consul": {
14+
implementation 'org.springframework.cloud:spring-cloud-starter-consul-discovery'
15+
break;
16+
}
17+
case "eureka": {
18+
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
19+
break;
20+
}
21+
case "zookeeper": {
22+
implementation 'org.springframework.cloud:spring-cloud-starter-zookeeper-discovery'
23+
break;
24+
}
25+
}
26+
27+
implementation project(':grpc-client-spring-boot-starter') // Replace with actual dependency "net.devh:grpc-client-spring-boot-starter:${springBootGrpcVersion}"
28+
implementation project(':examples:grpc-lib') // Replace with your grpc interface spec
29+
30+
// For demonstration only
831
implementation 'org.springframework.boot:spring-boot-starter-actuator'
9-
implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
10-
implementation project(':grpc-client-spring-boot-starter') // replace to implementation("net.devh:grpc-client-spring-boot-starter:${springBootGrpcVersion}")
11-
implementation project(':examples:grpc-lib')
32+
implementation 'org.springframework.boot:spring-boot-starter-web'
33+
}
34+
35+
bootRun {
36+
args = ["--spring.profiles.active=" + discoveryProvider]
1237
}

0 commit comments

Comments
 (0)