`
liujiekasini0312
  • 浏览: 156364 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Dubbo入门实例--转载

 
阅读更多

原文地址:http://blog.csdn.net/ruishenh/article/details/23180707?utm_source=tuicool

1.概述

Dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案

主要核心部件

Remoting: 网络通信框架,实现了sync-over-async 和 request-response 消息机制.

RPC: 一个远程过程调用的抽象,支持负载均衡、容灾和集群功能

Registry: 服务目录框架用于服务的注册和服务事件发布和订阅。

Dubbo采用全Spring配置方式,透明化接入应用,对应用没有任何API侵入,只需用Spring加载Dubbo的配置即可,Dubbo基于Spring的Schema扩展进行加载。

2.简单实例

demo文件下载:http://download.csdn.net/detail/ruishenh/7164585

首先maven项目增加dubbo的jar依赖,因为要用到zookeeper注册中心,也要依赖但是要去掉自带的log4j不然会默认的版本依赖jms-1.1.jarjmxtools-1.2.1.jarjmxri-1.2.1.jar等3个包,下载挺麻烦,当然如果个人已经在自己的仓库中有了就无所谓了。

  1. <!--dubbo-->
  2. <dependency>
  3. <groupId>com.alibaba</groupId>
  4. <artifactId>dubbo</artifactId>
  5. <version>2.0.13</version>
  6. </dependency>
  7. <dependency>
  8. <groupId>org.apache.zookeeper</groupId>
  9. <artifactId>zookeeper</artifactId>
  10. <version>3.3.6</version>
  11. <exclusions>
  12. <exclusion>
  13. <groupId>log4j</groupId>
  14. <artifactId>log4j</artifactId>
  15. </exclusion>
  16. </exclusions>
  17. </dependency>
  18. <dependency>
  19. <groupId>log4j</groupId>
  20. <artifactId>log4j</artifactId>
  21. <version>1.2.16</version>
  22. </dependency>



Spring的依赖自己添加就好了

因为要增加zookeeper的注册管理,所以如果有可用的zookeeper就用可用的zookeeper,没有可以按照如下的安装去本地安装一个。

http://blog.csdn.net/ruishenh/article/details/23180355

项目结构图


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

  1. <?xmlversion="1.0"encoding="UTF-8"?>
  2. <beansxmlnsbeansxmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans
  5. http://www.springframework.org/schema/beans/spring-beans.xsd
  6. http://code.alibabatech.com/schema/dubbo
  7. http://code.alibabatech.com/schema/dubbo/dubbo.xsd
  8. ">
  9. <dubbo:applicationnamedubbo:applicationname="hello-world-app"/>
  10. <!--zookeeper注册中心-->
  11. <dubbo:registryprotocoldubbo:registryprotocol="zookeeper"address="10.57.41.19:2181"/>
  12. <!--使用multicast广播注册中心暴露服务地址-->
  13. <!--<dubbo:registryaddress="multicast://10.57.41.19:1234"/>-->
  14. <dubbo:protocolnamedubbo:protocolname="dubbo"port="20880"/>
  15. <dubbo:serviceinterfacedubbo:serviceinterface="com.ruishenh.dubbo.example.DemoService"
  16. ref="demoService"/><!--和本地bean一样实现服务-->
  17. <beanidbeanid="demoService"class="com.ruishenh.dubbo.example.DemoServiceImpl"/>
  18. </beans>

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

  1. <?xmlversion="1.0"encoding="UTF-8"?>
  2. <beansxmlnsbeansxmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans
  6. http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://code.alibabatech.com/schema/dubbo
  8. http://code.alibabatech.com/schema/dubbo/dubbo.xsd
  9. ">
  10. <!--消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样-->
  11. <dubbo:applicationnamedubbo:applicationname="consumer-of-helloworld-app"/>
  12. <!--zookeeper注册中心-->
  13. <dubbo:registryprotocol="zookeeper"address="10.57.41.19:2181"/>
  14. <!--使用multicast广播注册中心暴露的服务地址-->
  15. <!--<dubbo:registryaddress="multicast://10.57.41.19:1234"/>-->
  16. <!--生成远程服务代理,可以和本地bean一样使用demoService-->
  17. <dubbo:referenceiddubbo:referenceid="demoService"interface="com.ruishenh.dubbo.example.DemoService"/>
  18. </beans>



/gomeTest/src/main/java/com/ruishenh/dubbo/example/DemoService.java

  1. packagecom.ruishenh.dubbo.example;
  2. publicinterfaceDemoService{
  3. publicvoidsayHello();
  4. publicStringreturnHello();
  5. publicMsgInforeturnMsgInfo(MsgInfoinfo);
  6. }



/gomeTest/src/main/java/com/ruishenh/dubbo/example/DemoServiceImpl.java

  1. packagecom.ruishenh.dubbo.example;
  2. publicclassDemoServiceImplimplementsDemoService{
  3. publicvoidsayHello(){
  4. System.out.println("helloworld!");
  5. }
  6. publicStringreturnHello(){
  7. return"helloworld!";
  8. }
  9. publicMsgInforeturnMsgInfo(MsgInfoinfo){
  10. info.getMsgs().add("处理完毕");
  11. returninfo;
  12. }
  13. }



/gomeTest/src/main/java/com/ruishenh/dubbo/example/LuncherProvider.java

  1. packagecom.ruishenh.dubbo.example;
  2. importorg.springframework.context.ApplicationContext;
  3. importorg.springframework.context.support.ClassPathXmlApplicationContext;
  4. publicclassLuncherProvider{
  5. publicstaticvoidmain(String[]args)throwsInterruptedException{
  6. LuncherProviderluncher=newLuncherProvider();
  7. luncher.start();
  8. Thread.sleep(1000*60*10);
  9. }
  10. voidstart(){
  11. StringconfigLocation="spring/dubbo-provider.xml";
  12. ApplicationContextcontext=newClassPathXmlApplicationContext(configLocation);
  13. String[]names=context.getBeanDefinitionNames();
  14. System.out.print("Beans:");
  15. for(Stringstring:names)
  16. System.out.print(string+",");
  17. System.out.println();
  18. }
  19. }



/gomeTest/src/main/java/com/ruishenh/dubbo/example/LuncherConsumer.java

  1. packagecom.ruishenh.dubbo.example;
  2. importjava.util.ArrayList;
  3. importjava.util.List;
  4. importorg.springframework.context.ApplicationContext;
  5. importorg.springframework.context.support.ClassPathXmlApplicationContext;
  6. publicclassLuncherConsumer{
  7. publicstaticvoidmain(String[]args)throwsInterruptedException{
  8. LuncherConsumerluncher=newLuncherConsumer();
  9. luncher.start();
  10. }
  11. voidstart(){
  12. StringconfigLocation="spring/dubbo-consumer.xml";
  13. ApplicationContextcontext=newClassPathXmlApplicationContext(configLocation);
  14. DemoServiceds=(DemoService)context.getBean("demoService");
  15. String[]names=context.getBeanDefinitionNames();
  16. System.out.print("Beans:");
  17. for(Stringstring:names){
  18. System.out.print(string);
  19. System.out.print(",");
  20. }
  21. System.out.println();
  22. MsgInfoinfo=newMsgInfo();
  23. info.setId(1);
  24. info.setName("ruisheh");
  25. List<String>msgs=newArrayList<String>();
  26. msgs.add("I");
  27. msgs.add("am");
  28. msgs.add("test");
  29. info.setMsgs(msgs);
  30. System.out.println(ds.returnMsgInfo(info).getMsgs());
  31. }
  32. }



/gomeTest/src/main/java/com/ruishenh/dubbo/example/MsgInfo.java

  1. packagecom.ruishenh.dubbo.example;
  2. importjava.io.Serializable;
  3. importjava.util.List;
  4. publicclassMsgInfoimplementsSerializable{
  5. privatestaticfinallongserialVersionUID=-2814022769568306965L;
  6. intid;
  7. Stringname;
  8. List<String>msgs;
  9. publicintgetId(){
  10. returnid;
  11. }
  12. publicvoidsetId(intid){
  13. this.id=id;
  14. }
  15. publicStringgetName(){
  16. returnname;
  17. }
  18. publicvoidsetName(Stringname){
  19. this.name=name;
  20. }
  21. publicList<String>getMsgs(){
  22. returnmsgs;
  23. }
  24. publicvoidsetMsgs(List<String>msgs){
  25. this.msgs=msgs;
  26. }
  27. }



//启动provider

- Refreshingorg.springframework.context.support.ClassPathXmlApplicationContext@42b988a6:startup date [Tue Apr 08 13:43:59 CST 2014]; root of context hierarchy

- Loading XML bean definitions from classpath resource [spring/dubbo-provider.xml]

- using logger:com.alibaba.dubbo.common.logger.support.Log4jLoggerFactory

- Pre-instantiating singletons inorg.springframework.beans.factory.support.DefaultListableBeanFactory@7c2e1f1f:defining beans[hello-world-app,com.alibaba.dubbo.config.RegistryConfig,dubbo,com.ruishenh.dubbo.example.DemoService,demoService];root of factory hierarchy

-[DUBBO] No dubbo.properties found on the class path., dubbo version:2.0.13, current host: 127.0.0.1

-[DUBBO] Export dubbo service com.ruishenh.dubbo.example.DemoService tourldubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=hello-world-app&dubbo=2.0.13&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=,dubbo version: 2.0.13, current host: 127.0.0.1

-[DUBBO] Register dubbo service com.ruishenh.dubbo.example.DemoServiceurl dubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=hello-world-app&dubbo=2.0.13&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=to registry registry://10.57.41.19:2181/com.alibaba.dubbo.registry.RegistryService?application=hello-world-app&registry=zookeeper,dubbo version: 2.0.13, current host: 127.0.0.1

-[DUBBO] Start NettyServer bind /0.0.0.0:20880, export/10.57.41.19:20880, dubbo version: 2.0.13, current host: 127.0.0.1

- Client environment:zookeeper.version=3.3.6-1366786,built on 07/29/2012 06:22 GMT

- Clientenvironment:host.name=houchangren.ds.gome.com.cn

- Client environment:java.version=1.6.0_26

- Client environment:java.vendor=SunMicrosystems Inc.

- Clientenvironment:java.home=D:\application\Java\jdk1.6.0_26\jre

- Clientenvironment:java.class.path=D:\workspace\20140326\gomeTest\target\classes;D:\jar\jars\jai_imageio-1.1-alpha.jar;D:\jar\jars\rocketmq\rocketmq-broker-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-client-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-common-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-example-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-namesrv-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-remoting-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-research-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-store-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-tools-3.0.8.jar;D:\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;D:\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar;D:\repository\commons-codec\commons-codec\1.2\commons-codec-1.2.jar;D:\repository\org\apache\httpcomponents\httpclient\4.2.3\httpclient-4.2.3.jar;D:\repository\org\apache\httpcomponents\httpcore\4.2.3\httpcore-4.2.3.jar;D:\repository\org\apache\httpcomponents\httpmime\4.2.3\httpmime-4.2.3.jar;D:\repository\ch\qos\logback\logback-classic\1.1.1\logback-classic-1.1.1.jar;D:\repository\org\slf4j\slf4j-api\1.7.6\slf4j-api-1.7.6.jar;D:\repository\ch\qos\logback\logback-core\1.1.1\logback-core-1.1.1.jar;D:\repository\org\swinglabs\swingx\1.6.1\swingx-1.6.1.jar;D:\repository\com\jhlabs\filters\2.0.235\filters-2.0.235.jar;D:\repository\org\swinglabs\swing-worker\1.1\swing-worker-1.1.jar;D:\repository\redis\clients\jedis\2.4.2\jedis-2.4.2.jar;D:\repository\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar;D:\repository\org\springframework\spring-webmvc\3.1.0.RELEASE\spring-webmvc-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-asm\3.1.0.RELEASE\spring-asm-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-context-support\3.1.0.RELEASE\spring-context-support-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-web\3.1.0.RELEASE\spring-web-3.1.0.RELEASE.jar;D:\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\repository\org\springframework\spring-test\3.1.0.RELEASE\spring-test-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-expression\3.1.0.RELEASE\spring-expression-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-tx\3.1.0.RELEASE\spring-tx-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-aop\3.1.0.RELEASE\spring-aop-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-beans\3.1.0.RELEASE\spring-beans-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-core\3.1.0.RELEASE\spring-core-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-context\3.1.0.RELEASE\spring-context-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-jdbc\3.1.0.RELEASE\spring-jdbc-3.1.0.RELEASE.jar;D:\repository\org\quartz-scheduler\quartz\1.7.2\quartz-1.7.2.jar;D:\repository\com\alibaba\dubbo\2.0.13\dubbo-2.0.13.jar;D:\repository\org\springframework\spring\2.5.6.SEC03\spring-2.5.6.SEC03.jar;D:\repository\org\javassist\javassist\3.15.0-GA\javassist-3.15.0-GA.jar;D:\repository\org\jboss\netty\netty\3.2.5.Final\netty-3.2.5.Final.jar;D:\repository\org\apache\zookeeper\zookeeper\3.3.6\zookeeper-3.3.6.jar;D:\repository\jline\jline\0.9.94\jline-0.9.94.jar;D:\repository\log4j\log4j\1.2.16\log4j-1.2.16.jar;D:\repository\org\codehaus\jackson\jackson-core-asl\1.8.4\jackson-core-asl-1.8.4.jar;D:\repository\org\codehaus\jackson\jackson-mapper-asl\1.8.4\jackson-mapper-asl-1.8.4.jar;D:\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;D:\repository\javax\servlet\jsp-api\2.0\jsp-api-2.0.jar

- Client environment:java.library.path=D:\application\Java\jdk1.6.0_26\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramFiles (x86)\NVIDIACorporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\application\Java\jdk1.6.0_26\bin;D:\application\apache-maven-3.1.0\bin;D:\application\TortoiseSVN\bin;D:\application\SlikSvn\bin;D:\application\Java\jdk1.6.0_26\lib;C:\ProgramFiles (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\application\Java\jdk1.6.0_26\bin;D:\application\apache-maven-3.1.0\bin;D:\application\TortoiseSVN\bin;D:\application\SlikSvn\bin;D:\application\Java\jdk1.6.0_26\lib;;D:\application\IDMComputerSolutions\UltraEdit\;D:\application\Java\jdk1.6.0_26\bin;D:\application\Java\jdk1.6.0_26\jre\bin;.

- Clientenvironment:java.io.tmpdir=C:\Users\HOUCHA~1\AppData\Local\Temp\

- Clientenvironment:java.compiler=<NA>

- Client environment:os.name=Windows 7

- Client environment:os.arch=amd64

- Client environment:os.version=6.1

- Client environment:user.name=houchangren

- Clientenvironment:user.home=C:\Users\houchangren

- Clientenvironment:user.dir=D:\workspace\20140326\gomeTest

- Initiating client connection,connectString=10.57.41.19:2181 sessionTimeout=60000watcher=com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry$1@a3468f4

- Opening socket connection to server/10.57.41.19:2181

-[DUBBO] Register: dubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=hello-world-app&dubbo=2.0.13&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=,dubbo version: 2.0.13, current host: 127.0.0.1

- Socket connection established tohouchangren.ds.gome.com.cn/10.57.41.19:2181, initiating session

- Session establishment complete on serverhouchangren.ds.gome.com.cn/10.57.41.19:2181, sessionid = 0x1453fd17c750004,negotiated timeout = 40000

-[DUBBO] Recover register services[dubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=hello-world-app&dubbo=2.0.13&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=],dubbo version: 2.0.13, current host: 127.0.0.1

-[DUBBO] Register:dubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=hello-world-app&dubbo=2.0.13&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=,dubbo version: 2.0.13, current host: 127.0.0.1

Beans:hello-world-app,com.alibaba.dubbo.config.RegistryConfig,dubbo,com.ruishenh.dubbo.example.DemoService,demoService,

//这两句是在有consumer执行后的日志

-[DUBBO] All clients has discontected from /10.57.41.19:20880. You cangraceful shutdown now., dubbo version: 2.0.13, current host: 127.0.0.1

-[DUBBO] disconected from/10.57.41.19:58330,url:dubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=hello-world-app&channel.readonly.sent=true&codec=dubbo&codec.downstream=dubbo&dubbo=2.0.13&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=,dubbo version: 2.0.13, current host: 127.0.0.1

//启动Consumer

- Refreshingorg.springframework.context.support.ClassPathXmlApplicationContext@42b988a6:startup date [Tue Apr 08 13:45:09 CST 2014]; root of context hierarchy

- Loading XML bean definitions from classpath resource [spring/dubbo-consumer.xml]

- using logger:com.alibaba.dubbo.common.logger.support.Log4jLoggerFactory

- Pre-instantiating singletons inorg.springframework.beans.factory.support.DefaultListableBeanFactory@250d593e:defining beans[consumer-of-helloworld-app,com.alibaba.dubbo.config.RegistryConfig,demoService];root of factory hierarchy

-[DUBBO] No dubbo.properties found on the class path., dubbo version:2.0.13, current host: 127.0.0.1

- Client environment:zookeeper.version=3.3.6-1366786,built on 07/29/2012 06:22 GMT

- Clientenvironment:host.name=houchangren.ds.gome.com.cn

- Client environment:java.version=1.6.0_26

- Client environment:java.vendor=SunMicrosystems Inc.

- Client environment:java.home=D:\application\Java\jdk1.6.0_26\jre

- Clientenvironment:java.class.path=D:\workspace\20140326\gomeTest\target\classes;D:\jar\jars\jai_imageio-1.1-alpha.jar;D:\jar\jars\rocketmq\rocketmq-broker-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-client-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-common-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-example-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-namesrv-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-remoting-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-research-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-store-3.0.8.jar;D:\jar\jars\rocketmq\rocketmq-tools-3.0.8.jar;D:\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;D:\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar;D:\repository\commons-codec\commons-codec\1.2\commons-codec-1.2.jar;D:\repository\org\apache\httpcomponents\httpclient\4.2.3\httpclient-4.2.3.jar;D:\repository\org\apache\httpcomponents\httpcore\4.2.3\httpcore-4.2.3.jar;D:\repository\org\apache\httpcomponents\httpmime\4.2.3\httpmime-4.2.3.jar;D:\repository\ch\qos\logback\logback-classic\1.1.1\logback-classic-1.1.1.jar;D:\repository\org\slf4j\slf4j-api\1.7.6\slf4j-api-1.7.6.jar;D:\repository\ch\qos\logback\logback-core\1.1.1\logback-core-1.1.1.jar;D:\repository\org\swinglabs\swingx\1.6.1\swingx-1.6.1.jar;D:\repository\com\jhlabs\filters\2.0.235\filters-2.0.235.jar;D:\repository\org\swinglabs\swing-worker\1.1\swing-worker-1.1.jar;D:\repository\redis\clients\jedis\2.4.2\jedis-2.4.2.jar;D:\repository\org\apache\commons\commons-pool2\2.0\commons-pool2-2.0.jar;D:\repository\org\springframework\spring-webmvc\3.1.0.RELEASE\spring-webmvc-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-asm\3.1.0.RELEASE\spring-asm-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-context-support\3.1.0.RELEASE\spring-context-support-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-web\3.1.0.RELEASE\spring-web-3.1.0.RELEASE.jar;D:\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\repository\org\springframework\spring-test\3.1.0.RELEASE\spring-test-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-expression\3.1.0.RELEASE\spring-expression-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-tx\3.1.0.RELEASE\spring-tx-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-aop\3.1.0.RELEASE\spring-aop-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-beans\3.1.0.RELEASE\spring-beans-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-core\3.1.0.RELEASE\spring-core-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-context\3.1.0.RELEASE\spring-context-3.1.0.RELEASE.jar;D:\repository\org\springframework\spring-jdbc\3.1.0.RELEASE\spring-jdbc-3.1.0.RELEASE.jar;D:\repository\org\quartz-scheduler\quartz\1.7.2\quartz-1.7.2.jar;D:\repository\com\alibaba\dubbo\2.0.13\dubbo-2.0.13.jar;D:\repository\org\springframework\spring\2.5.6.SEC03\spring-2.5.6.SEC03.jar;D:\repository\org\javassist\javassist\3.15.0-GA\javassist-3.15.0-GA.jar;D:\repository\org\jboss\netty\netty\3.2.5.Final\netty-3.2.5.Final.jar;D:\repository\org\apache\zookeeper\zookeeper\3.3.6\zookeeper-3.3.6.jar;D:\repository\jline\jline\0.9.94\jline-0.9.94.jar;D:\repository\log4j\log4j\1.2.16\log4j-1.2.16.jar;D:\repository\org\codehaus\jackson\jackson-core-asl\1.8.4\jackson-core-asl-1.8.4.jar;D:\repository\org\codehaus\jackson\jackson-mapper-asl\1.8.4\jackson-mapper-asl-1.8.4.jar;D:\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;D:\repository\javax\servlet\jsp-api\2.0\jsp-api-2.0.jar

- Clientenvironment:java.library.path=D:\application\Java\jdk1.6.0_26\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramFiles (x86)\NVIDIACorporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\application\Java\jdk1.6.0_26\bin;D:\application\apache-maven-3.1.0\bin;D:\application\TortoiseSVN\bin;D:\application\SlikSvn\bin;D:\application\Java\jdk1.6.0_26\lib;C:\ProgramFiles (x86)\NVIDIACorporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\application\Java\jdk1.6.0_26\bin;D:\application\apache-maven-3.1.0\bin;D:\application\TortoiseSVN\bin;D:\application\SlikSvn\bin;D:\application\Java\jdk1.6.0_26\lib;;D:\application\IDMComputer Solutions\UltraEdit\;D:\application\Java\jdk1.6.0_26\bin;D:\application\Java\jdk1.6.0_26\jre\bin;.

- Clientenvironment:java.io.tmpdir=C:\Users\HOUCHA~1\AppData\Local\Temp\

- Clientenvironment:java.compiler=<NA>

- Client environment:os.name=Windows 7

- Client environment:os.arch=amd64

- Client environment:os.version=6.1

- Client environment:user.name=houchangren

- Clientenvironment:user.home=C:\Users\houchangren

- Clientenvironment:user.dir=D:\workspace\20140326\gomeTest

- Initiating client connection,connectString=10.57.41.19:2181 sessionTimeout=60000watcher=com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry$1@219ba640

- Opening socket connection to server/10.57.41.19:2181

- Socket connection established to houchangren.ds.gome.com.cn/10.57.41.19:2181,initiating session

-[DUBBO] Subscribe:subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello,dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Register:subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello,dubbo version: 2.0.13, current host: 10.57.41.19

- Session establishment complete on serverhouchangren.ds.gome.com.cn/10.57.41.19:2181, sessionid = 0x1453fd17c750005,negotiated timeout = 40000

-[DUBBO] Recover register services[subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello],dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Register:subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello,dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Start NettyClient houchangren/10.57.41.19 connect to the server/10.57.41.19:20880, dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Recover subscribe services{subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello=[com.alibaba.dubbo.registry.support.RegistryDirectory@57922f46]},dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Subscribe:subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello,dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Register:subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello,dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Refer dubbo service com.ruishenh.dubbo.example.DemoService fromurlzookeeper://10.57.41.19:2181/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=,dubbo version: 2.0.13, current host: 10.57.41.19

Beans:consumer-of-helloworld-app,com.alibaba.dubbo.config.RegistryConfig,demoService,

[I, am, test, 处理完毕]

-[DUBBO] Run shutdown hook now., dubbo version: 2.0.13, current host:10.57.41.19

-[DUBBO] Close all registries[zookeeper://10.57.41.19:2181/com.alibaba.dubbo.registry.RegistryService?application=consumer-of-helloworld-app&refer=application%3Dconsumer-of-helloworld-app%26dubbo%3D2.0.13%26id%3DdemoService%26interface%3Dcom.ruishenh.dubbo.example.DemoService%26methods%3DreturnMsgInfo%2CreturnHello%2CsayHello],dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Destroy registry:zookeeper://10.57.41.19:2181/com.alibaba.dubbo.registry.RegistryService?application=consumer-of-helloworld-app&refer=application%3Dconsumer-of-helloworld-app%26dubbo%3D2.0.13%26id%3DdemoService%26interface%3Dcom.ruishenh.dubbo.example.DemoService%26methods%3DreturnMsgInfo%2CreturnHello%2CsayHello,dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Unregister:subscribe://10.57.41.19/com.ruishenh.dubbo.example.DemoService?application=consumer-of-helloworld-app&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello,dubbo version: 2.0.13, current host: 10.57.41.19

- Session: 0x1453fd17c750005 closed

- EventThread shut down

-[DUBBO] Destroy reference:dubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=consumer-of-helloworld-app&check=false&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=,dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Close netty channel [id: 0x3fdb484d, /10.57.41.19:58314 =>/10.57.41.19:20880], dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] disconected from/10.57.41.19:20880,url:dubbo://10.57.41.19:20880/com.ruishenh.dubbo.example.DemoService?anyhost=true&application=consumer-of-helloworld-app&check=false&codec=dubbo&dubbo=2.0.13&id=demoService&interface=com.ruishenh.dubbo.example.DemoService&methods=returnMsgInfo,returnHello,sayHello&prompt=dubbo&revision=,dubbo version: 2.0.13, current host: 10.57.41.19

-[DUBBO] Close dubbo connect: 10.57.41.19:0-->10.57.41.19:20880, dubboversion: 2.0.13, current host: 10.57.41.19

-[DUBBO] Close dubbo connect: 10.57.41.19:0-->10.57.41.19:20880, dubboversion: 2.0.13, current host: 10.57.41.19

分享到:
评论

相关推荐

    dubbo-demo-consumer、dubbo-demo-provider、dubbo-simple-monitor

    本篇将详细讲解基于dubbo-demo-consumer、dubbo-demo-provider和dubbo-simple-monitor的实例服务,带你深入理解Dubbo的核心概念和操作流程。 首先,我们来看`dubbo-demo-consumer`,它是Dubbo服务的消费者。消费者...

    dubbo-monitor-simple-2.5.8-assembly.tar.gz

    《Dubbo监控工具详解——基于dubbo-monitor-simple-2.5.8》 在分布式系统开发中,监控是至关重要的一个环节,它可以帮助开发者实时了解服务的运行状态,及时发现并解决问题。Apache Dubbo,作为一款高性能、轻量级...

    jmeter-plugins-dubbo-2.7.8-jar-with-dependencies.jar

    jmeter的dubbo插件,jmeter-plugins-dubbo-2.7.8-jar-with-dependencies.jar,适用于JMeter5.4.1版本,将解压后的文件jmeter-plugins-dubbo-2.7.8-jar-with-dependencies放在Jmeter安装目录下的\lib\ext文件夹中,...

    dubbo-dubbo-2.7.3.rar

    dubbo源码dubbo-dubbo-2.7.3.rardubbo源码dubbo-dubbo-2.7.3.rardubbo源码dubbo-dubbo-2.7.3.rardubbo源码dubbo-dubbo-2.7.3.rardubbo源码dubbo-dubbo-2.7.3.rardubbo源码dubbo-dubbo-2.7.3.rardubbo源码dubbo-dubbo...

    dubbo-admin-2.5.4.war

    dubbo-admin-2.5.4提供支持JDK1.7及JDK1.8的War包 Dubbo是Alibaba开源的分布式服务框架,它最大的特点是按照分层的方式来架构,使用这种方式可以使各个层之间解耦合(或者最大限度地松耦合)。从服务模型的角度来看...

    dubbo-admin-2.5.4.war后台管理

    其中,`dubbo-admin`是Dubbo的核心组件之一,它提供了一个可视化的管理控制台,帮助开发者对服务进行管理和监控。本文将详细解析`dubbo-admin-2.5.4.war`这个版本的后台管理工具,探讨其主要特性和使用方法。 首先...

    dubbo-admin-2.5.4及dubbo-monitor-2.5.3 安装及配置

    dubbo-admin安装要点: 1.清空tomcat/webapps/ROOT目录 2.将包解压到tomcat/webapps/ROOT下 3.修改tomcat/webapps/ROOT/WEB-INF/dubbo.properties 文件 dubbo.registry.address dubbo接口服务注册地址: 单机...

    jmeter-plugins-dubbo-2.7.1-jar-with-dependencies

    本文将深入探讨“jmeter-plugins-dubbo-2.7.1-jar-with-dependencies”这一系统压测工具包,它专门针对基于Java的Dubbo服务进行性能测试。了解并熟练掌握这一工具,能帮助我们更好地优化服务性能,提升系统的稳定性...

    dubbo-monitor-simple-2.6.1.tgz

    dubbo官方自带了dubbo-admin及dubbo-simple/dubbo-monitor-simple二个子项目用于服务治理及服务监控。 dubbo-monitor-simple是Alibaba的开源项目,用于监控在dubbo框架下接口暴露,注册情况,也可以看接口的调用...

    dubbo-monitor-simple

    `dubbo-monitor-simple`提供了基础的监控能力,包括但不限于以下几点: 1. **服务调用统计**:记录服务的调用次数、成功率、平均耗时等,这些数据可以帮助开发者了解服务的运行状况,及时发现性能瓶颈。 2. **服务...

    dubbo-admin-2.8.4.war

    dubbo 最新dubbo-admin-2.8.4.war 菜单报错已修改。

    dobbo源码dubbo-dubbo-2.7.3.rar

    dobbo源码dubbo-dubbo-2.7.3.rardobbo源码dubbo-dubbo-2.7.3.rardobbo源码dubbo-dubbo-2.7.3.rardobbo源码dubbo-dubbo-2.7.3.rardobbo源码dubbo-dubbo-2.7.3.rardobbo源码dubbo-dubbo-2.7.3.rardobbo源码dubbo-dubbo...

    jmeter-plugins-dubbo-2.7.1-jar-with-dependencies (1)

    本文将深入探讨"jmeter-plugins-dubbo-2.7.1-jar-with-dependencies (1)"这个压缩包中的关键知识点。 1. **JMeter Plugins for Dubbo** JMeter Plugins for Dubbo 是一个扩展了JMeter功能的插件,专门用于测试基于...

    dubbo监控中心dubbo-monitor-simple

    该包为dubbo-monitor,使用方法请参见博文 《Dubbo进阶(五)—— dubbo-monitor-simple使用》 https://blog.csdn.net/sunhuaqiang1/article/details/80141478

    springboot2.0.x+dubbo-spring-boot-starter

    标题 "springboot2.0.x+dubbo-spring-boot-starter" 涉及的是将流行的微服务框架 Dubbo 集成到 Spring Boot 2.0.x 的项目实践中。这个集成使得开发者能够利用 Spring Boot 的便利性和 Dubbo 的高性能远程服务调用...

    jmeter-plugins-dubbo-2.7.1-jar-with-dependencies.jar.zip

    jmeter-plugins-dubbo-2.7.1-jar-with-dependencies 2.jar jmeter本身并不支持dubbo接口的测试,需要下载第三方插件,然后将jar包放入${JMETER_HOME}\lib\ext路径下,重启即可。

Global site tag (gtag.js) - Google Analytics