• Dubbo入门实例


    1.概述

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

    主要核心部件

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

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

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

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

    2.简单实例

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


    com.alibaba
    dubbo
    2.0.13


    org.apache.zookeeper
    zookeeper
    3.3.6


    log4j
    log4j




    log4j
    log4j
    1.2.16

    Spring的依赖自己添加就好了

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

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

    项目结构图

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


    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
    ">


    ref=“demoService”/>

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


    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
    ">








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

    package com.ruishenh.dubbo.example;
    public interfaceDemoService {
      
       publicvoidsayHello();
       
       publicString returnHello();
       
       publicMsgInfo returnMsgInfo(MsgInfo info);
       
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

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

    package com.ruishenh.dubbo.example;

    public classDemoServiceImpl implements DemoService{

    public void sayHello() {
    System.out.println(“hello world!”);
    }

    public String returnHello() {
    return “hello world!”;
    }

    public MsgInforeturnMsgInfo(MsgInfo info) {
    info.getMsgs().add(“处理完毕”);
    return info;
    }
    }

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

    package com.ruishenh.dubbo.example;

    importorg.springframework.context.ApplicationContext;
    importorg.springframework.context.support.ClassPathXmlApplicationContext;

    public class LuncherProvider {
    publicstatic void main(String[] args) throws InterruptedException{
    LuncherProviderluncher=new LuncherProvider();
    luncher.start();
    Thread.sleep(1000*60*10);
    }

         voidstart(){
           StringconfigLocation="spring/dubbo-provider.xml";
           ApplicationContextcontext =new ClassPathXmlApplicationContext(configLocation);
           String\[\] names=context.getBeanDefinitionNames();
           System.out.print("Beans:");
           for(String string : names)
          System.out.print(string+",");
           System.out.println();
         }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    }

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

    package com.ruishenh.dubbo.example;

    import java.util.ArrayList;
    import java.util.List;

    importorg.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;

    public class LuncherConsumer {
    publicstatic void main(String[] args) throws InterruptedException{
    LuncherConsumerluncher=new LuncherConsumer();
    luncher.start();
    }

         voidstart(){
    
    • 1

    StringconfigLocation=“spring/dubbo-consumer.xml”;
    ApplicationContextcontext =new ClassPathXmlApplicationContext(configLocation);
    DemoServiceds=(DemoService) context.getBean(“demoService”);
    String[] names=context.getBeanDefinitionNames();
    System.out.print(“Beans:”);
    for(String string : names) {
    System.out.print(string);
    System.out.print(“,”);
    }
    System.out.println();

    MsgInfoinfo =new MsgInfo();
    info.setId(1);
    info.setName(“ruisheh”);
    Listmsgs=new ArrayList();
    msgs.add(“I”);
    msgs.add(“am”);
    msgs.add(“test”);
    info.setMsgs(msgs);

    System.out.println(ds.returnMsgInfo(info).getMsgs());
    }
    }

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

    package com.ruishenh.dubbo.example;
    import java.io.Serializable;
    import java.util.List;
    public class MsgInfo implementsSerializable {
             privatestatic final long serialVersionUID = -2814022769568306965L;
             intid;
             Stringname;
             Listmsgs;
             publicint getId() {
               returnid;
             }
             publicvoid setId(int id) {
               this.id= id;
             }
             publicString getName() {
               returnname;
             }
             publicvoid setName(String name) {
               this.name= name;
             }
             publicList getMsgs() {
               returnmsgs;
             }
             publicvoid setMsgs(List msgs) {
               this.msgs= msgs;
             }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 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.DemoServiceanyhost=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.DemoServiceanyhost=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.RegistryServiceapplication=hello-world-app®istry=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:applicationJavajdk1.6.0_26jre

    - Clientenvironment:java.class.path=D:workspace?40326gomeTest argetclasses;D:jarjarsjai_imageio-1.1-alpha.jar;D:jarjars ocketmq ocketmq-broker-3.0.8.jar;D:jarjars ocketmq ocketmq-client-3.0.8.jar;D:jarjars ocketmq ocketmq-common-3.0.8.jar;D:jarjars ocketmq ocketmq-example-3.0.8.jar;D:jarjars ocketmq ocketmq-namesrv-3.0.8.jar;D:jarjars ocketmq ocketmq-remoting-3.0.8.jar;D:jarjars ocketmq ocketmq-research-3.0.8.jar;D:jarjars ocketmq ocketmq-store-3.0.8.jar;D:jarjars ocketmq ocketmq-tools-3.0.8.jar;D: epositorycommons-httpclientcommons-httpclient.1commons-httpclient-3.1.jar;D: epositorycommons-loggingcommons-logging.0.4commons-logging-1.0.4.jar;D: epositorycommons-codeccommons-codec.2commons-codec-1.2.jar;D: epositoryorgapachehttpcomponentshttpclient.2.3httpclient-4.2.3.jar;D: epositoryorgapachehttpcomponentshttpcore.2.3httpcore-4.2.3.jar;D: epositoryorgapachehttpcomponentshttpmime.2.3httpmime-4.2.3.jar;D: epositorychqoslogbacklogback-classic.1.1logback-classic-1.1.1.jar;D: epositoryorgslf4jslf4j-api.7.6slf4j-api-1.7.6.jar;D: epositorychqoslogbacklogback-core.1.1logback-core-1.1.1.jar;D: epositoryorgswinglabsswingx.6.1swingx-1.6.1.jar;D: epositorycomjhlabs ilters.0.235 ilters-2.0.235.jar;D: epositoryorgswinglabsswing-worker.1swing-worker-1.1.jar;D: epository edisclientsjedis.4.2jedis-2.4.2.jar;D: epositoryorgapachecommonscommons-pool2.0commons-pool2-2.0.jar;D: epositoryorgspringframeworkspring-webmvc.1.0.RELEASEspring-webmvc-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-asm.1.0.RELEASEspring-asm-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-context-support.1.0.RELEASEspring-context-support-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-web.1.0.RELEASEspring-web-3.1.0.RELEASE.jar;D: epositoryaopallianceaopalliance.0aopalliance-1.0.jar;D: epositoryorgspringframeworkspring-test.1.0.RELEASEspring-test-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-expression.1.0.RELEASEspring-expression-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-tx.1.0.RELEASEspring-tx-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-aop.1.0.RELEASEspring-aop-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-beans.1.0.RELEASEspring-beans-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-core.1.0.RELEASEspring-core-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-context.1.0.RELEASEspring-context-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-jdbc.1.0.RELEASEspring-jdbc-3.1.0.RELEASE.jar;D: epositoryorgquartz-schedulerquartz.7.2quartz-1.7.2.jar;D: epositorycomalibabadubbo.0.13dubbo-2.0.13.jar;D: epositoryorgspringframeworkspring.5.6.SEC03spring-2.5.6.SEC03.jar;D: epositoryorgjavassistjavassist.15.0-GAjavassist-3.15.0-GA.jar;D: epositoryorgjboss etty etty.2.5.Final etty-3.2.5.Final.jar;D: epositoryorgapachezookeeperzookeeper.3.6zookeeper-3.3.6.jar;D: epositoryjlinejline.9.94jline-0.9.94.jar;D: epositorylog4jlog4j.2.16log4j-1.2.16.jar;D: epositoryorgcodehausjacksonjackson-core-asl.8.4jackson-core-asl-1.8.4.jar;D: epositoryorgcodehausjacksonjackson-mapper-asl.8.4jackson-mapper-asl-1.8.4.jar;D: epositoryjavaxservletservlet-api.5servlet-api-2.5.jar;D: epositoryjavaxservletjsp-api.0jsp-api-2.0.jar

    - Client environment:java.library.path=D:applicationJavajdk1.6.0_26in;C:WindowsSunJavain;C:Windowssystem32;C:Windows;C:ProgramFiles (x86)NVIDIACorporationPhysXCommon;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShell1.0;D:applicationJavajdk1.6.0_26in;D:applicationapache-maven-3.1.0in;D:applicationTortoiseSVNin;D:applicationSlikSvnin;D:applicationJavajdk1.6.0_26lib;C:ProgramFiles (x86)NVIDIA CorporationPhysXCommon;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShell1.0;D:applicationJavajdk1.6.0_26in;D:applicationapache-maven-3.1.0in;D:applicationTortoiseSVNin;D:applicationSlikSvnin;D:applicationJavajdk1.6.0_26lib;;D:applicationIDMComputerSolutionsUltraEdit;D:applicationJavajdk1.6.0_26in;D:applicationJavajdk1.6.0_26jrein;.

    - Clientenvironment:java.io.tmpdir=C:UsersHOUCHA~1AppDataLocalTemp

    - Clientenvironment:java.compiler=

    - 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:Usershouchangren

    - Clientenvironment:user.dir=D:workspace?40326gomeTest

    - 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.DemoServiceanyhost=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.DemoServiceanyhost=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.DemoServiceanyhost=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.DemoServiceanyhost=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:applicationJavajdk1.6.0_26jre

    - Clientenvironment:java.class.path=D:workspace?40326gomeTest argetclasses;D:jarjarsjai_imageio-1.1-alpha.jar;D:jarjars ocketmq ocketmq-broker-3.0.8.jar;D:jarjars ocketmq ocketmq-client-3.0.8.jar;D:jarjars ocketmq ocketmq-common-3.0.8.jar;D:jarjars ocketmq ocketmq-example-3.0.8.jar;D:jarjars ocketmq ocketmq-namesrv-3.0.8.jar;D:jarjars ocketmq ocketmq-remoting-3.0.8.jar;D:jarjars ocketmq ocketmq-research-3.0.8.jar;D:jarjars ocketmq ocketmq-store-3.0.8.jar;D:jarjars ocketmq ocketmq-tools-3.0.8.jar;D: epositorycommons-httpclientcommons-httpclient.1commons-httpclient-3.1.jar;D: epositorycommons-loggingcommons-logging.0.4commons-logging-1.0.4.jar;D: epositorycommons-codeccommons-codec.2commons-codec-1.2.jar;D: epositoryorgapachehttpcomponentshttpclient.2.3httpclient-4.2.3.jar;D: epositoryorgapachehttpcomponentshttpcore.2.3httpcore-4.2.3.jar;D: epositoryorgapachehttpcomponentshttpmime.2.3httpmime-4.2.3.jar;D: epositorychqoslogbacklogback-classic.1.1logback-classic-1.1.1.jar;D: epositoryorgslf4jslf4j-api.7.6slf4j-api-1.7.6.jar;D: epositorychqoslogbacklogback-core.1.1logback-core-1.1.1.jar;D: epositoryorgswinglabsswingx.6.1swingx-1.6.1.jar;D: epositorycomjhlabs ilters.0.235 ilters-2.0.235.jar;D: epositoryorgswinglabsswing-worker.1swing-worker-1.1.jar;D: epository edisclientsjedis.4.2jedis-2.4.2.jar;D: epositoryorgapachecommonscommons-pool2.0commons-pool2-2.0.jar;D: epositoryorgspringframeworkspring-webmvc.1.0.RELEASEspring-webmvc-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-asm.1.0.RELEASEspring-asm-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-context-support.1.0.RELEASEspring-context-support-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-web.1.0.RELEASEspring-web-3.1.0.RELEASE.jar;D: epositoryaopallianceaopalliance.0aopalliance-1.0.jar;D: epositoryorgspringframeworkspring-test.1.0.RELEASEspring-test-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-expression.1.0.RELEASEspring-expression-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-tx.1.0.RELEASEspring-tx-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-aop.1.0.RELEASEspring-aop-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-beans.1.0.RELEASEspring-beans-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-core.1.0.RELEASEspring-core-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-context.1.0.RELEASEspring-context-3.1.0.RELEASE.jar;D: epositoryorgspringframeworkspring-jdbc.1.0.RELEASEspring-jdbc-3.1.0.RELEASE.jar;D: epositoryorgquartz-schedulerquartz.7.2quartz-1.7.2.jar;D: epositorycomalibabadubbo.0.13dubbo-2.0.13.jar;D: epositoryorgspringframeworkspring.5.6.SEC03spring-2.5.6.SEC03.jar;D: epositoryorgjavassistjavassist.15.0-GAjavassist-3.15.0-GA.jar;D: epositoryorgjboss etty etty.2.5.Final etty-3.2.5.Final.jar;D: epositoryorgapachezookeeperzookeeper.3.6zookeeper-3.3.6.jar;D: epositoryjlinejline.9.94jline-0.9.94.jar;D: epositorylog4jlog4j.2.16log4j-1.2.16.jar;D: epositoryorgcodehausjacksonjackson-core-asl.8.4jackson-core-asl-1.8.4.jar;D: epositoryorgcodehausjacksonjackson-mapper-asl.8.4jackson-mapper-asl-1.8.4.jar;D: epositoryjavaxservletservlet-api.5servlet-api-2.5.jar;D: epositoryjavaxservletjsp-api.0jsp-api-2.0.jar

    - Clientenvironment:java.library.path=D:applicationJavajdk1.6.0_26in;C:WindowsSunJavain;C:Windowssystem32;C:Windows;C:ProgramFiles (x86)NVIDIACorporationPhysXCommon;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShell1.0;D:applicationJavajdk1.6.0_26in;D:applicationapache-maven-3.1.0in;D:applicationTortoiseSVNin;D:applicationSlikSvnin;D:applicationJavajdk1.6.0_26lib;C:ProgramFiles (x86)NVIDIACorporationPhysXCommon;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShell1.0;D:applicationJavajdk1.6.0_26in;D:applicationapache-maven-3.1.0in;D:applicationTortoiseSVNin;D:applicationSlikSvnin;D:applicationJavajdk1.6.0_26lib;;D:applicationIDMComputer SolutionsUltraEdit;D:applicationJavajdk1.6.0_26in;D:applicationJavajdk1.6.0_26jrein;.

    - Clientenvironment:java.io.tmpdir=C:UsersHOUCHA~1AppDataLocalTemp

    - Clientenvironment:java.compiler=

    - 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:Usershouchangren

    - Clientenvironment:user.dir=D:workspace?40326gomeTest

    - 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.DemoServiceapplication=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.DemoServiceapplication=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.DemoServiceapplication=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.DemoServiceapplication=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.DemoServiceapplication=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.DemoServiceapplication=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.DemoServiceapplication=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.RegistryServiceanyhost=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.RegistryServiceapplication=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.RegistryServiceapplication=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.DemoServiceapplication=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.DemoServiceanyhost=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.DemoServiceanyhost=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

    9

  • 相关阅读:
    深入理解JVM虚拟机第四篇:一些常用的JVM虚拟机
    【深度学习】(2) Transformer 网络解析,代码复现,附Pytorch完整代码
    java项目-第160期ssm大学生校园兼职系统_ssm毕业设计_计算机毕业设计
    elasticsearch+kibana部署
    面向对象设计介绍和代码示例
    【力扣】两数之和 II - 输入有序数组
    Linux常用命令——常用网络命令【二】
    kafka生产者异步发送、同步发送、回调异步发送,是什么情况?
    MIPI CSI-2笔记(7) -- Low Level Protocol(C-PHY物理层校验和生成,包间隔)
    情态动词习题
  • 原文地址:https://blog.csdn.net/m0_67393342/article/details/126327981