File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1212
1313这里选择更优的方式,在dubbo的服务层之上提供一个API网关,由API网关负责对dubbo服务的访问(可以考虑用泛化的方式去调用),这样所有的业务系统只要以Restful的方式调用API网关即可调用dubbo服务。
1414
15- 在dubbo-api中定义服务提供方为服务消费方暴露接口
15+ 在dubbo-api中定义服务提供方为服务消费方暴露接口:
1616
1717``` java
1818public interface TestService {
@@ -22,7 +22,7 @@ public interface TestService {
2222
2323** 服务提供方**
2424
25- 添加依赖
25+ 添加依赖:
2626
2727``` xml
2828<dependencies >
@@ -40,7 +40,7 @@ public interface TestService {
4040</dependencies >
4141```
4242
43- 在application.properties添加dubbo的相关配置信息
43+ 在application.properties添加dubbo的相关配置信息:
4444
4545``` properties
4646# 当前dubbo应用id
@@ -58,7 +58,7 @@ dubbo.protocol.port=20880
5858
5959注:这个配置只针对服务提供方,消费方不用指定协议,它自己会根据服务端的地址信息和@Reference 注解去解析协议。
6060
61- 在Spring Boot Application的上添加` @EnableDubbo ` ,表示要开启dubbo功能. (dubbo provider服务可以使用或者不使用web容器)
61+ 在Spring Boot Application的上添加` @EnableDubbo ` ,表示要开启dubbo功能。 (dubbo provider服务可以使用或者不使用web容器)
6262
6363``` java
6464@EnableDubbo
@@ -88,7 +88,7 @@ public class TestServiceImpl implements TestService {
8888
8989** 服务消费方**
9090
91- 添加依赖
91+ 添加依赖:
9292
9393``` xml
9494<dependencies >
@@ -106,7 +106,7 @@ public class TestServiceImpl implements TestService {
106106</dependencies >
107107```
108108
109- 在application.properties添加dubbo的相关配置信息
109+ 在application.properties添加dubbo的相关配置信息:
110110
111111``` properties
112112# 当前dubbo应用id
You can’t perform that action at this time.
0 commit comments