dubbo使用

dubbo使用

介绍
  1. dubbo介绍
    一款高性能、透明的远程过程调用框架。
  2. 框架描述:可以查看官网dubbo中文文档
使用描述
  1. 配置方式

     xml文件(推荐)
     	dubbo-providor.xml
     			<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     					 xmlns:dubbo="http://dubbo.apache.org/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://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
     					<!-- 应用名称 -->
     					<dubbo:application name="demo-provider"/>
     					<!-- -注册地址->
     					<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
     					<!-- 协议-->
     					<dubbo:protocol name="dubbo" port="20890"/>
     					<!-- 将要被暴露的服务的实现类-->
     					<bean id="demoService" class="org.apache.dubbo.samples.basic.impl.DemoServiceImpl"/>
     					<!-- 暴露的服务 -->
     					<dubbo:service interface="org.apache.dubbo.samples.basic.api.DemoService" ref="demoService"/>
     			</beans>
     	dubbo-consumer.xml
     			<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     				       xmlns:dubbo="http://dubbo.apache.org/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://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
     				    <dubbo:application name="demo-consumer"/>
     				    <dubbo:registry group="aaa" address="zookeeper://127.0.0.1:2181"/>
     				    <dubbo:reference id="demoService" check="false" interface="org.apache.dubbo.samples.basic.api.DemoService"/>
     				</beans>
     			
    
     java注解(不好说)
    
  2. 组件(架构)

     节点		角色说明
     Provider	暴露服务的服务提供方
     Consumer	调用远程服务的服务消费方
     Registry	服务注册与发现的注册中心
     Monitor	统计服务的调用次数调用间的监控中心
     Container	服务运行容器	
    
  3. 调用方式

Q&A

相关文章

在网络请求时,总会有各种异常情况出现,我们需要提前处理这...
作者:宇曾背景软件技术的发展历史,从单体的应用,逐渐演进...
hello,大家好呀,我是小楼。最近一个技术群有同学at我,问我...
 一个软件开发人员,工作到了一定的年限(一般是3、4年左右...
当一个服务调用另一个远程服务出现错误时的外观Dubbo提供了多...
最近在看阿里开源RPC框架Dubbo的源码,顺带梳理了一下其中用...