File tree 5 files changed +36
-40
lines changed
40.Spring-Boot-Dubbo-Zookeeper 5 files changed +36
-40
lines changed Original file line number Diff line number Diff line change 39
39
</dependency >
40
40
<!-- dubbo -->
41
41
<dependency >
42
- <groupId >com.alibaba.spring. boot</groupId >
42
+ <groupId >com.alibaba.boot</groupId >
43
43
<artifactId >dubbo-spring-boot-starter</artifactId >
44
- <version >2.0 .0</version >
44
+ <version >0.2 .0</version >
45
45
</dependency >
46
+
46
47
<!-- zookeeper -->
47
48
<dependency >
48
49
<groupId >org.apache.zookeeper</groupId >
Original file line number Diff line number Diff line change 1
1
package cc .mrbird ;
2
2
3
- import com .alibaba .dubbo .spring .boot .annotation .EnableDubboConfiguration ;
3
+ import com .alibaba .dubbo .config . spring .context .annotation .EnableDubbo ;
4
4
import org .springframework .boot .SpringApplication ;
5
5
import org .springframework .boot .autoconfigure .SpringBootApplication ;
6
6
7
+ @ EnableDubbo
7
8
@ SpringBootApplication
8
- @ EnableDubboConfiguration
9
- public class Applicaiton {
9
+ public class ConsumerApplicaiton {
10
10
public static void main (String [] args ) {
11
- SpringApplication .run (Applicaiton .class , args );
11
+ SpringApplication .run (ConsumerApplicaiton .class , args );
12
12
}
13
13
}
Original file line number Diff line number Diff line change 1
1
server :
2
2
port : 8081
3
- spring :
4
- dubbo :
5
- application :
6
- # 服务名称,保持唯一
7
- name : server-consumer
8
- # zookeeper地址,用于向其注册服务
9
- registry :
10
- address : zookeeper://127.0.0.1:2181
11
- protocol :
12
- # dubbo协议,固定写法
13
- name : dubbo
14
- # 扫描需要调用服务的类路径
15
- scan : cc.mrbird.consumer.controller
3
+
4
+ dubbo :
5
+ application :
6
+ # 服务名称,保持唯一
7
+ name : server-consumer
8
+ # zookeeper地址,用于从中获取注册的服务
9
+ registry :
10
+ address : zookeeper://127.0.0.1:2181
11
+ protocol :
12
+ # dubbo协议,固定写法
13
+ name : dubbo
Original file line number Diff line number Diff line change 1
1
package cc .mrbird ;
2
2
3
- import com .alibaba .dubbo .spring .boot .annotation .EnableDubboConfiguration ;
3
+ import com .alibaba .dubbo .config . spring .context .annotation .EnableDubbo ;
4
4
import org .springframework .boot .SpringApplication ;
5
5
import org .springframework .boot .autoconfigure .SpringBootApplication ;
6
6
7
+ @ EnableDubbo
7
8
@ SpringBootApplication
8
- @ EnableDubboConfiguration
9
- public class Applicaiton {
9
+ public class ProviderApplicaiton {
10
10
public static void main (String [] args ) {
11
- SpringApplication .run (Applicaiton .class , args );
11
+ SpringApplication .run (ProviderApplicaiton .class , args );
12
12
System .out .println ("complete" );
13
13
}
14
14
}
Original file line number Diff line number Diff line change 1
1
server :
2
2
port : 8080
3
- spring :
4
- dubbo :
5
- application :
6
- # 服务名称,保持唯一
7
- name : server-provider
8
- # zookeeper地址,用于向其注册服务
9
- registry :
10
- address : zookeeper://127.0.0.1:2181
11
- # 暴露服务方式
12
- protocol :
13
- # dubbo协议,固定写法
14
- name : dubbo
15
- # 暴露服务端口 (默认是20880,不同的服务提供者端口不能重复)
16
- port : 20880
17
- server : true
18
- # 扫描需要暴露服务的类路径
19
- scan : cc.mrbird.provider.service
3
+
4
+ dubbo :
5
+ application :
6
+ # 服务名称,保持唯一
7
+ name : server-provider
8
+ # zookeeper地址,用于向其注册服务
9
+ registry :
10
+ address : zookeeper://127.0.0.1:2181
11
+ # 暴露服务方式
12
+ protocol :
13
+ # dubbo协议,固定写法
14
+ name : dubbo
15
+ # 暴露服务端口 (默认是20880,不同的服务提供者端口不能重复)
16
+ port : 20880
You can’t perform that action at this time.
0 commit comments