这篇博客只是我自己的学习记录,对各位高手怕是没有什么太大的帮助,望高手不吝赐教。

项目的截图如下:

我们使用的主要就是红框里面的。





这里我主要分析两个xml





/DubboTest/src/main/resources/spring/dubbo-provider.xml

<?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="hello-world-app" />

	<!-- zookeeper注册中心 -->
	<dubbo:registry protocol="zookeeper" address="10.150.0.80:2181" />
	<!-- 使用multicast广播注册中心暴露服务地址 -->
	<!-- <dubbo:registry address="multicast://10.57.41.19:1234" /> -->
	<dubbo:protocol name="dubbo" port="20880" />

	<!-- 和本地bean一样实现服务 -->
	<dubbo:service interface="com.ruishenh.dubbo.example.DemoService" ref="demoService3" />       

	<bean id="demoService3" class="com.ruishenh.dubbo.example.DemoServiceImpl" />
</beans>

/DubboTest/src/main/resources/spring/dubbo-consumer.xml

<?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="consumer-of-helloworld-app" />
	<!-- zookeeper注册中心 -->
	<dubbo:registry  protocol="zookeeper" address="10.150.0.80:2181" />
	<!-- 使用multicast广播注册中心暴露的服务地址 -->
	<!--<dubbo:registry address="multicast://10.57.41.19:1234" /> -->
	 <!-- 生成远程服务代理,可以和本地bean一样使用demoService -->
	<dubbo:reference id="demoService3" interface="com.ruishenh.dubbo.example.DemoService" />
</beans>

我就记录一点

在consumer.xml里面

<dubbo:reference id="demoService3" interface="com.ruishenh.dubbo.example.DemoService" />

这个id指的是

<bean id="demoService3" class="com.ruishenh.dubbo.example.DemoServiceImpl" />

这里面这个id。

服务引用BeanId

我自己以前总觉得<dubbo:service里面应该有个一个id,<dubbo:reference里面应该有个一个属性叫做fromid,指向dubbo:service那个id









另外

dubbo还有一个admin管理界面,请自行百度之。

项目代码:

http://pan.baidu.com/s/1hqVbbQs

Dubbo粗浅记录的更多相关文章

  1. Dubbo学习记录

    参考资料: 官网 Dubbo详细介绍与安装使用过程

  2. JEECMS9.3集成dubbo操作记录

    需求描述: 门户及其他应用系统需要查询JEECMS9.3中发布的栏目及数据,而其他系统都是基于dubbo开发的,因此想要将JEECMS9.3中集成dubbo并对外提供内容管理服务. 需求实现: 1.添 ...

  3. SpringBoot开发案例之整合Dubbo分布式服务

    前言 在 SpringBoot 很火热的时候,阿里巴巴的分布式框架 Dubbo 不知是处于什么考虑,在停更N年之后终于进行维护了.在之前的微服务中,使用的是当当维护的版本 Dubbox,整合方式也是使 ...

  4. dubbo服务使用spring-data-mongodb进行时间查询的bug记录

    一.项目情况:spring-boot+mongodb+dubbo. 二.问题:调用dubbo服务并使用spring-data-mongodb的gte,lte时间段比较查询, @Reference(re ...

  5. dubbo 源码编译记录

    DUBBO是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,是阿里巴巴SOA服务化治理方案的核心框架,阿里内部采用sofa框架,同属于分布式RPC框架,dubbo开源,而sofa ...

  6. spring boot +dubbo 踩坑记录

    今天初次搭建spring boot +duboo的demo.记录一下踩坑记录. 首先搭建3个小demo,一个maven项目,两个spring boot (服务提供者和服务消费者)项目. 两 sprin ...

  7. 从应用层到网络层排查 Dubbo 接口超时全记录

    大家好,我是坤哥 我们常说面试造火箭,很多人对此提出质疑,相信大家看了这篇文章会明白面试造火箭的道理,这篇排查问题的技巧涉及到索引,GC,容器,网络抓包,全链路追踪等基本技能,没有这些造火箭的本事,排 ...

  8. dubbo系列二、dubbo请求流程记录

    目录 1.dubbo请求处理流程 1.1. consumer端处理流程 1.2.provider端处理流程 1.3.dubbo请求分析记录-图 泳道图 xmind图 2.dubbo请求核心说明 1.d ...

  9. dubbo系列十一、dubbo transport层记录

    前言 在dubbo接口方法重载且入参未显式指定序列化id导致ClassCastException分析时候用到了dubbo的通信层和编解码,dubbo有个transport层,默认使用netty4进行网 ...

随机推荐

  1. js添加key为数字的对象,通过类似于通过访问数组的中括号形式访问对象属性

    var obj={};obj[1] = "mm";obj[2]="nn";console.log(obj[1]); 同var obj={};obj[" ...

  2. easyui常见问题

    EasyUi combobox 下拉列表JS添加首/尾选择项 下拉列表获取数据后,再动态添加一项数据项,如:"<option value=''>全部</option> ...

  3. 81. Search in Rotated Sorted Array II (中等)

    Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e. ...

  4. JAVA 第二天 内部类

    package com.company; /** * Created by Administrator on 2016/8/23. */ public class Outter {//生成的字节码文件 ...

  5. 渗透测试环境DVWA搭建

    一.DVWA介绍 DVWA(Damn Vulnerable Web Application)是一个用来进行安全脆弱性鉴定的PHP/MySQL Web应用,旨在为安全专业人员测试自己的专业技能和工具提供 ...

  6. ACM Misha and Changing Handles

    Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user ...

  7. jQuery 遍历 – 后代

    后代是子.孙.曾孙等等. 通过 jQuery,您能够向下遍历 DOM 树,以查找元素的后代. 向下遍历 DOM 树 下面是两个用于向下遍历 DOM 树的 jQuery 方法: children() f ...

  8. Android仅2步实现 滚粗 汉堡导航栏效果~ 全新底部导航交互(滑动隐藏)

    本文同步自wing的地方酒馆 布吉岛大家有木有看这一篇文章,再见,汉堡菜单,我们有了新的 Android 交互设计方案 本库下载地址:https://github.com/githubwing/Bye ...

  9. Java程序员的Golang入门指南(上)

    Java程序员的Golang入门指南 1.序言 Golang作为一门出身名门望族的编程语言新星,像豆瓣的Redis平台Codis.类Evernote的云笔记leanote等. 1.1 为什么要学习 如 ...

  10. android studio 转为eclipse快捷键后还存在的问题汇总

    提取局部变量:Ctrl+Alt+V 提取全局变量:Ctrl+Alt+F 提取方法:Shit+Alt+M 使用android studio 出现红色下划线代表有错误产生,eclipse中的Ctrl+1( ...