dubbo(provider,consumer)点到点直连配置
来源:互联网 发布:最短路径算法 最优 编辑:程序博客网 时间:2024/06/05 01:02
可参看例子
1.服务端接口配置(providr样例)applicationContext-dubbo-smk.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd" >
<!-- 声明需要暴露的服务接口,直连时,token=true要去掉,会有不安全因素,但直连一般用于内部使用,安全问题可以暂忽略 -->
<dubbo:service interface="com.hoperun.biz.smk.service.SmkService" ref="smkService" version="1.0"/>
</beans>
2.服务端注册配置:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!-- 提供方应用信息,用于计算依赖关系 -->
<dubbo:application name="znmhcommon"></dubbo:application>
<!-- dubbo接口去除注册中心,采用直连的方式 -->
<dubbo:registry address="N/A" />
<!-- 使用multicast广播注册中心暴露发现服务地址 -->
<!-- <dubbo:registry address="multicast://224.5.6.7:1234?unicast=false" />-->
<!--dubbo集群开发,请激活下面条目,并注销上面的多播multicast -->
<!--<dubbo:registry protocol="zookeeper" address="10.254.201.232:2181,10.254.201.68:2181" />-->
<!-- 用dubbo协议在20880端口暴露服务 -->
<dubbo:protocol name="dubbo" port="20880" ></dubbo:protocol>
<!-- <dubbo:service interface="com.hoperun.biz.commons.service.DownloadService" version="1.0" ref="downloadService" />
<dubbo:service interface="com.hoperun.biz.commons.service.UploadService" version="1.0" ref="uploadService" />-->
</beans>
3.dubbo客户端配置(consumer)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd" >
<!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
<dubbo:application name="consumer-of-znmhcommon" />
<!-- dubbo接口去除注册中心,采用直连的方式 -->
<!-- <dubbo:registry address="N/A" ></dubbo:registry> -->
<!-- 使用multicast广播注册中心暴露发现服务地址 -->
<!-- <dubbo:registry address="multicast://224.5.6.7:1234?unicast=false" />-->
<!--
<dubbo:registry protocol="zookeeper" address="10.254.201.68:2181,10.254.201.232:2181"
/>
-->
<!-- 生成远程服务代理,可以和本地bean一样使用 -->
<dubbo:consumer timeout="30000" >
</dubbo:consumer>
<dubbo:reference
id="demoService"
interface="com.hoperun.biz.demoservice.service.DemoService"
url="dubbo://127.0.0.1:20880/com.hoperun.biz.demoservice.service.DemoService"
version="1.0" />
<dubbo:reference
id="smkService"
interface="com.hoperun.biz.smk.service.SmkService"
url="dubbo://10.254.201.123:20880/com.hoperun.biz.smk.service.SmkService"
version="1.0" />
</beans>
- dubbo(provider,consumer)点到点直连配置
- dubbo(provider,consumer)点到点直连配置
- dubbo(provider,consumer)点到点直连配置
- dubbo直连提供者
- dubbo直连
- dubbo直连
- Dubbo直连提供者
- dubbo服务点对点直连
- dubbo--直连方式(51)
- DUBBO学习:直连提供者
- Dubbo开发直连调试
- 第六章 dubbo之 zookeeper + provider + consumer
- Dubbo学习笔记(三) Provider和Consumer
- 关于dubbo的provider和consumer都配置timeout超时时间的情况
- 关于dubbo的provider和consumer都配置timeout超时时间的情况
- 关于dubbo的provider和consumer都配置timeout超时时间的情况
- 关于dubbo的provider和consumer都配置timeout超时时间的情况
- Linux IPsec点到点配置
- Document(文档)、View(视图)、Frame(框架)、App(应用)之间相互访问
- 极光推送--总结
- 知道这些正则表达式,让你少些N行代码
- matplotlib:path effects
- 请编写一个c函数,该函数给出一个字节中被置为1的位的个数
- dubbo(provider,consumer)点到点直连配置
- 在友盟分享的基础上集成微信登录
- 英文专业名词收集
- intent传数据和EventBus各自用处
- web开发性能优化---UI界面篇
- Android 生命周期的注意点
- android 全屏去掉状态栏和横竖屏设定
- bzoj 3230 相似子串 后缀数组
- 解读Tapestry5.1——页面渲染