【六祎 - Dubbo】Dubbo 应用 XML配置分析;Dubbo 配置篇;Dubbo参考手册

Dubbo 应用 XML配置分析

    • 演示案例:
      • 提供者代码
      • xml配置
      • 消费者代码
      • xml配置

参考地址:

  • 手动配置

    • https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/config/overview/
  • 配置说明

    • xml配置
      • https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/config/xml/
    • 配置工作原理
      • https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/config/principle/
  • 配置项手册

    • https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/reference-manual/config/properties/#protocol

protocol
在这里插入图片描述provider
在这里插入图片描述consumer
在这里插入图片描述config-center
在这里插入图片描述

演示案例:

提供者代码

public class Application {
    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/dubbo-provider.xml");
        context.start();
        System.in.read();
    }
}

xml配置

<?xml version="1.0" encoding="UTF-8"?>
 
<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-4.3.xsd
       http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">

    <!--
    dubbo:
        application:指定应用名等应用级别相关信息【必填】
    -->
    <dubbo:application name="demo-provider" metadata-type="remote">
        <dubbo:parameter key="mapping-type" value="metadata"/>
    </dubbo:application>

    <!--
    dubbo:
        config-center: 配置中心类型、地址及相关配置
        metadata-report:元数据中心类型、地址及相关配置
        registry:注册中心类型、地址及相关配置【必填】
    -->
    <dubbo:config-center address="zookeeper://10.151.110.52:2181"/>
    <dubbo:metadata-report address="zookeeper://10.151.110.52:2181"/>
    <dubbo:registry id="registry1" address="zookeeper://10.151.110.52:2181"/>


    <!--
    dubbo:
        protocol:要暴露的 RPC 协议及相关配置如端口号等
    -->
    <dubbo:protocol name="dubbo" port="-1"/>

    <bean id="demoService" class="org.apache.dubbo.demo.provider.DemoServiceImpl"/>
    <bean id="greetingService" class="org.apache.dubbo.demo.provider.GreetingServiceImpl"/>

    <!--
    dubbo:
        service:声明普通接口或实现类为 Dubbo 服务
    -->
    <dubbo:service interface="org.apache.dubbo.demo.DemoService" timeout="3000" ref="demoService" registry="registry1"/>
    <dubbo:service version="1.0.0" group="greeting" timeout="5000" interface="org.apache.dubbo.demo.GreetingService"
                   ref="greetingService"/>

</beans>

privoder控制台打印

[20/11/23 14:55:45:341 CST] DubboSaveMetadataReport-thread-1  INFO zookeeper.ZookeeperMetadataReport:  [DUBBO] store provider metadata. Identifier : org.apache.dubbo.metadata.report.identifier.MetadataIdentifier@c8ae94a; definition: FullServiceDefinition{parameters={mapping-type=metadata, side=provider, service.name=ServiceBean:greeting/org.apache.dubbo.demo.GreetingService:1.0.0, release=, methods=hello, deprecated=false, qos.port=22222, dubbo=2.0.2, interface=org.apache.dubbo.demo.GreetingService, version=1.0.0, generic=false, timeout=5000, revision=1.0.0, mapping.type=metadata, metadata-type=remote, application=demo-provider, dynamic=true, group=greeting, anyhost=true}} ServiceDefinition [canonicalName=org.apache.dubbo.demo.GreetingService, codeSource=file:/D:/apache_projects/dubbo/dubbo-demo/dubbo-demo-interface/target/classes/, methods=[MethodDefinition [name=hello, parameterTypes=[], returnType=java.lang.String]]], dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:351 CST] main  INFO config.ServiceConfig:  [DUBBO] No valid ip found from environment, try to get local host., dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:353 CST] main  INFO config.ServiceConfig:  [DUBBO] Export dubbo service org.apache.dubbo.demo.DemoService to local registry url : injvm://127.0.0.1/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-provider&bind.ip=192.168.109.130&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=13704&qos.port=22222&release=&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=provider&timeout=3000&timestamp=1700463345344, dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:354 CST] main  INFO config.ServiceConfig:  [DUBBO] Register dubbo service org.apache.dubbo.demo.DemoService url dubbo://192.168.109.130:20880/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-provider&bind.ip=192.168.109.130&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=13704&qos.port=22222&release=&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=provider&timeout=3000&timestamp=1700463345344 to registry registry://192.168.109.130:2181/org.apache.dubbo.registry.RegistryService?application=demo-provider&dubbo=2.0.2&id=registry1&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&pid=13704&qos.port=22222&registry=zookeeper&timestamp=1700463345343, dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:357 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Register: dubbo://192.168.109.130:20880/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-provider&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=13704&release=&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=provider&timeout=3000&timestamp=1700463345344, dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:359 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Subscribe: provider://192.168.109.130:20880/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-provider&bind.ip=192.168.109.130&bind.port=20880&category=configurators&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=13704&qos.port=22222&release=&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=provider&timeout=3000&timestamp=1700463345344, dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:361 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Notify urls for subscribe url provider://192.168.109.130:20880/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-provider&bind.ip=192.168.109.130&bind.port=20880&category=configurators&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=13704&qos.port=22222&release=&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=provider&timeout=3000&timestamp=1700463345344, urls: [empty://192.168.109.130:20880/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-provider&bind.ip=192.168.109.130&bind.port=20880&category=configurators&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=13704&qos.port=22222&release=&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=provider&timeout=3000&timestamp=1700463345344], dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:364 CST] DubboSaveMetadataReport-thread-1  INFO zookeeper.ZookeeperMetadataReport:  [DUBBO] store provider metadata. Identifier : org.apache.dubbo.metadata.report.identifier.MetadataIdentifier@441ae1a3; definition: FullServiceDefinition{parameters={mapping-type=metadata, side=provider, service.name=ServiceBean:/org.apache.dubbo.demo.DemoService, release=, methods=sayHello,sayHelloAsync, deprecated=false, qos.port=22222, dubbo=2.0.2, interface=org.apache.dubbo.demo.DemoService, generic=false, timeout=3000, mapping.type=metadata, metadata-type=remote, application=demo-provider, dynamic=true, anyhost=true}} ServiceDefinition [canonicalName=org.apache.dubbo.demo.DemoService, codeSource=file:/D:/apache_projects/dubbo/dubbo-demo/dubbo-demo-interface/target/classes/, methods=[MethodDefinition [name=sayHello, parameterTypes=[java.lang.String], returnType=java.lang.String], MethodDefinition [name=sayHelloAsync, parameterTypes=[java.lang.String], returnType=java.util.concurrent.CompletableFuture]]], dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:369 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] DubboBootstrap is ready., dubbo version: , current host: 192.168.109.130


[20/11/23 14:55:45:371 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] DubboBootstrap has started., dubbo version: , current host: 192.168.109.130


消费者代码

public class Application {
    /**
     * In order to make sure multicast registry works, need to specify '-Djava.net.preferIPv4Stack=true' before
     * launch the application
     */
    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/dubbo-consumer.xml");
        context.start();
        DemoService demoService = context.getBean("demoService", DemoService.class);
        GreetingService greetingService = context.getBean("greetingService", GreetingService.class);

        new Thread(() -> {
            while (true) {
                String greetings = greetingService.hello();
                System.out.println(greetings + " from separated thread.");
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();

        while (true) {
            CompletableFuture<String> hello = demoService.sayHelloAsync("world");
            System.out.println("result: " + hello.get());

            String greetings = greetingService.hello();
            System.out.println("result: " + greetings);

            Thread.sleep(5000);
        }
    }
}

consumer控制台打印

[20/11/23 15:02:29:857 CST] main  INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.109.130:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@4d098f9b


[20/11/23 15:02:29:922 CST] main-SendThread(r.nacos.com:2181)  INFO zookeeper.ClientCnxn: Opening socket connection to server r.nacos.com/192.168.109.130:2181. Will not attempt to authenticate using SASL (unknown error)

[20/11/23 15:02:29:922 CST] main-SendThread(r.nacos.com:2181)  INFO zookeeper.ClientCnxn: Socket connection established to r.nacos.com/192.168.109.130:2181, initiating session


[20/11/23 15:02:29:923 CST] main  INFO imps.CuratorFrameworkImpl: Default schema

[20/11/23 15:02:29:932 CST] main-SendThread(r.nacos.com:2181)  INFO zookeeper.ClientCnxn: Session establishment complete on server r.nacos.com/192.168.109.130:2181, sessionid = 0x10001273e960005, negotiated timeout = 40000


[20/11/23 15:02:29:939 CST] main-EventThread  INFO state.ConnectionStateManager: State change: CONNECTED # 连接状态

[20/11/23 15:02:29:940 CST] main  INFO zookeeper.ZookeeperTransporter:  [DUBBO] No valid zookeeper client found from cache, therefore create a new client for url. zookeeper://192.168.109.130:2181/ConfigCenterConfig?check=true&config-file=dubbo.properties&group=dubbo&highest-priority=false&timeout=3000, dubbo version: , current host: 192.168.109.130

[20/11/23 15:02:29:962 CST] Curator-ConnectionStateManager-0  INFO curator.CuratorZookeeperClient:  [DUBBO] Curator zookeeper client instance initiated successfully, session id is 10001273e960005, dubbo version: , current host: 192.168.109.130
    
    
[20/11/23 15:02:29:986 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] No global configuration in config center, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:29:987 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] No application level configuration in config center, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:008 CST] main  INFO utils.ConfigValidationUtils:  [DUBBO] No valid monitor config found, specify monitor info to enable collection of Dubbo statistics, dubbo version: , current host: 192.168.109.130
    
[20/11/23 15:02:30:039 CST] main  INFO zookeeper.ZookeeperMetadataReport:  [DUBBO] Load service store file C:\Users\.dubbo\dubbo-metadata-demo-consumer-192.168.109.130-2181.cache, data: {org.apache.dubbo.demo.DemoService:::consumer:demo-consumer={"mapping-type":"metadata","init":"false","side":"consumer","release":"","methods":"sayHello,sayHelloAsync","qos.port":"33333","dubbo":"2.0.2","check":"true","interface":"org.apache.dubbo.demo.DemoService","enable.auto.migration":"true","mapping.type":"metadata","metadata-type":"remote","application":"demo-consumer","sticky":"false","enable-auto-migration":"true"}, org.apache.dubbo.demo.GreetingService:1.0.0:greeting:consumer:demo-consumer={"mapping-type":"metadata","init":"false","side":"consumer","release":"","methods":"hello","qos.port":"33333","dubbo":"2.0.2","check":"false","interface":"org.apache.dubbo.demo.GreetingService","version":"1.0.0","revision":"1.0.0","enable.auto.migration":"true","mapping.type":"metadata","metadata-type":"remote","application":"demo-consumer","sticky":"false","enable-auto-migration":"true","group":"greeting"}}, dubbo version: , current host: 192.168.109.130
    
    
[20/11/23 15:02:30:060 CST] main  INFO zookeeper.ZookeeperTransporter:  [DUBBO] find valid zookeeper client from the cache for address: zookeeper://192.168.109.130:2181/org.apache.dubbo.metadata.report.MetadataReport?application=demo-consumer&port=2181&protocol=zookeeper, dubbo version: , current host: 192.168.109.130

[20/11/23 15:02:30:066 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] DubboBootstrap has been initialized!, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:066 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] DubboBootstrap is starting..., dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:071 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] DubboBootstrap is ready., dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:074 CST] main  INFO bootstrap.DubboBootstrap:  [DUBBO] DubboBootstrap has started., dubbo version: , current host: 192.168.109.130
    
[20/11/23 15:02:30:144 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Load registry cache file C:\Users\.dubbo\dubbo-registry-demo-consumer-192.168.109.130-2181.cache, data: {greeting/org.apache.dubbo.demo.GreetingService:1.0.0=empty://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=routers&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=4068&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700462778060&version=1.0.0 empty://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=configurators&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=4068&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700462778060&version=1.0.0 empty://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=providers&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=4068&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700462778060&version=1.0.0, org.apache.dubbo.demo.DemoService=empty://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=routers&check=true&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=4068&qos.port=33333&side=consumer&sticky=false&timestamp=1700462777472 empty://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=configurators&check=true&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=4068&qos.port=33333&side=consumer&sticky=false&timestamp=1700462777472 empty://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=providers&check=true&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=4068&qos.port=33333&side=consumer&sticky=false&timestamp=1700462777472}, dubbo version: , current host: 192.168.109.130


[20/11/23 15:02:30:144 CST] main  INFO zookeeper.ZookeeperTransporter:  [DUBBO] find valid zookeeper client from the cache for address: zookeeper://192.168.109.130:2181/org.apache.dubbo.registry.RegistryService?application=demo-consumer&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&id=org.apache.dubbo.config.RegistryConfig&interface=org.apache.dubbo.registry.RegistryService&mapping-type=metadata&mapping.type=metadata&pid=17228&qos.port=33333&timestamp=1700463750102, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:155 CST] main  INFO migration.MigrationRuleListener:  [DUBBO] Listening for migration rules on dataId-demo-consumer.migration group-MIGRATION, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:156 CST] main  INFO migration.MigrationRuleListener:  [DUBBO] Using the following migration rule to migrate:, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:157 CST] main  INFO migration.MigrationRuleListener:  [DUBBO] INIT, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:176 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Register: consumer://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=consumers&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=17228&qos.port=33333&side=consumer&sticky=false&timestamp=1700463750085, dubbo version: , current host: 192.168.109.130

[20/11/23 15:02:30:192 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Subscribe: consumer://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=providers,configurators,routers&check=true&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=17228&qos.port=33333&side=consumer&sticky=false&timestamp=1700463750085, dubbo version: , current host: 192.168.109.130

[20/11/23 15:02:30:204 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Notify urls for subscribe url consumer://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=providers,configurators,routers&check=true&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=17228&qos.port=33333&side=consumer&sticky=false&timestamp=1700463750085, urls: [dubbo://192.168.109.130:20880/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-provider&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=13704&release=release&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=provider&timeout=3000&timestamp=1700463345344, empty://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=configurators&check=true&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=17228&qos.port=33333&side=consumer&sticky=false&timestamp=1700463750085, empty://192.168.109.130/org.apache.dubbo.demo.DemoService?application=demo-consumer&category=routers&check=true&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=17228&qos.port=33333&side=consumer&sticky=false&timestamp=1700463750085], dubbo version: , current host: 192.168.109.130


[20/11/23 15:02:30:556 CST] NettyClientWorker-1-1  INFO netty4.NettyClientHandler:  [DUBBO] The connection of /192.168.109.130:62180 -> /192.168.109.130:20880 is established., dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:560 CST] main  INFO transport.AbstractClient:  [DUBBO] Successed connect to server /192.168.109.130:20880 from NettyClient 192.168.109.130 using dubbo version , channel is NettyChannel [channel=[id: 0x4d51818c, L:/192.168.109.130:62180 - R:/192.168.109.130:20880]], dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:560 CST] main  INFO transport.AbstractClient:  [DUBBO] Start NettyClient /192.168.109.130 connect to the server /192.168.109.130:20880, dubbo version: , current host: 192.168.109.130
    
    
[20/11/23 15:02:30:593 CST] main  INFO config.ReferenceConfig:  [DUBBO] Refer dubbo service org.apache.dubbo.demo.DemoService from url dubbo://192.168.109.130/org.apache.dubbo.demo.DemoService?anyhost=true&application=demo-consumer&check=true&deprecated=false&dubbo=2.0.2&dynamic=true&enable-auto-migration=true&enable.auto.migration=true&generic=false&init=false&interface=org.apache.dubbo.demo.DemoService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=sayHello,sayHelloAsync&pid=17228&qos.port=33333&register.ip=192.168.109.130&release=release&remote.application=demo-provider&service.name=ServiceBean:/org.apache.dubbo.demo.DemoService&side=consumer&sticky=false&timeout=3000&timestamp=1700463750085, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:665 CST] DubboSaveMetadataReport-thread-1  INFO zookeeper.ZookeeperMetadataReport:  [DUBBO] store consumer metadata. Identifier : org.apache.dubbo.metadata.report.identifier.MetadataIdentifier@528c11f0; definition: {mapping-type=metadata, init=false, side=consumer, release=, methods=sayHello,sayHelloAsync, qos.port=33333, dubbo=2.0.2, check=true, interface=org.apache.dubbo.demo.DemoService, enable.auto.migration=true, mapping.type=metadata, metadata-type=remote, application=demo-consumer, sticky=false, enable-auto-migration=true}, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:679 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Register: consumer://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=consumers&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=17228&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700463750672&version=1.0.0, dubbo version: , current host: 192.168.109.130


[20/11/23 15:02:30:683 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Subscribe: consumer://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=providers,configurators,routers&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=17228&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700463750672&version=1.0.0, dubbo version: , current host: 192.168.109.130
[20/11/23 15:02:30:686 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Notify urls for subscribe url consumer://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=providers,configurators,routers&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=17228&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700463750672&version=1.0.0, urls: [dubbo://192.168.109.130:20880/org.apache.dubbo.demo.GreetingService?anyhost=true&application=demo-provider&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=greeting&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=13704&release=release&revision=1.0.0&service.name=ServiceBean:greeting/org.apache.dubbo.demo.GreetingService:1.0.0&side=provider&timeout=5000&timestamp=1700463344841&version=1.0.0, empty://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=configurators&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=17228&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700463750672&version=1.0.0, empty://192.168.109.130/org.apache.dubbo.demo.GreetingService?application=demo-consumer&category=routers&check=false&dubbo=2.0.2&enable-auto-migration=true&enable.auto.migration=true&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=17228&qos.port=33333&revision=1.0.0&side=consumer&sticky=false&timestamp=1700463750672&version=1.0.0], dubbo version: , current host: 192.168.109.130

[20/11/23 15:02:30:688 CST] main  INFO config.ReferenceConfig:  [DUBBO] Refer dubbo service org.apache.dubbo.demo.GreetingService from url dubbo://192.168.109.130/org.apache.dubbo.demo.GreetingService?anyhost=true&application=demo-consumer&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&enable-auto-migration=true&enable.auto.migration=true&generic=false&group=greeting&init=false&interface=org.apache.dubbo.demo.GreetingService&mapping-type=metadata&mapping.type=metadata&metadata-type=remote&methods=hello&pid=17228&qos.port=33333&register.ip=192.168.109.130&release=release&remote.application=demo-provider&revision=1.0.0&service.name=ServiceBean:greeting/org.apache.dubbo.demo.GreetingService:1.0.0&side=consumer&sticky=false&timeout=5000&timestamp=1700463750672&version=1.0.0, dubbo version: , current host: 192.168.109.130


[20/11/23 15:02:30:688 CST] DubboSaveMetadataReport-thread-1  INFO zookeeper.ZookeeperMetadataReport:  [DUBBO] store consumer metadata. Identifier : org.apache.dubbo.metadata.report.identifier.MetadataIdentifier@53c78c1b; definition: {mapping-type=metadata, init=false, side=consumer, release=, methods=hello, qos.port=33333, dubbo=2.0.2, check=false, interface=org.apache.dubbo.demo.GreetingService, version=1.0.0, revision=1.0.0, enable.auto.migration=true, mapping.type=metadata, metadata-type=remote, application=demo-consumer, sticky=false, enable-auto-migration=true, group=greeting}, dubbo version: , current host: 192.168.109.130
result: async result
Greetings! from separated thread.
result: Greetings!
Greetings! from separated thread.
result: async result
result: Greetings!
result: async result
Greetings! from separated thread.

xml配置

<?xml version="1.0" encoding="UTF-8"?>

<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-4.3.xsd
       http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">

    <dubbo:application name="demo-consumer" >
        <dubbo:parameter key="mapping-type" value="metadata"/>
        <dubbo:parameter key="enable-auto-migration" value="true"/>
    </dubbo:application>

    <dubbo:metadata-report address="zookeeper://10.151.110.52:2181"/>

    <dubbo:registry address="zookeeper://10.151.110.52:2181"/>


    <!--
    dubbo
        reference:声明普通接口为 Dubbo 服务
-->
    <dubbo:reference id="demoService" check="true"
                     interface="org.apache.dubbo.demo.DemoService"/>

    <dubbo:reference version="1.0.0" group="greeting" id="greetingService" check="false"
                     interface="org.apache.dubbo.demo.GreetingService"/>

</beans>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/170436.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Haclon简介及数据类型

Haclon简介 HALCON是由德国MVtec公司开发的机器视觉算法包&#xff0c;它由一千多个各自独立的函数&#xff08;算子&#xff09;构成&#xff0c;其中除了包含各类滤波、色彩以及几何、数学转换、形态学计算分析、图像校正&#xff0c;目标分类辨识、形状搜寻等基本的图像处理…

Linux常用命令——builtin命令

在线Linux命令查询工具 builtin 执行shell内部命令 补充说明 builtin命令用于执行指定的shell内部命令&#xff0c;并返回内部命令的返回值。builtin命令在使用时&#xff0c;将不能够再使用Linux中的外部命令。当系统中定义了与shell内部命令相同的函数时&#xff0c;使用…

基于Python实现用于实时监控和分析 MySQL 服务器的性能指标和相关信息工具源码

MySQL命令行监控工具 - mysqlstat 介绍 mysqlstat 是一个命令行工具&#xff0c;用于实时监控和分析 MySQL 服务器的性能指标和相关信息。 它可以帮助 DBA&#xff08;数据库管理员&#xff09;和开发人员定位和解决数据库性能问题。 以下是 mysqlstat 工具的主要功能&#…

007 OpenCV霍夫变换

目录 一、环境 二、霍夫变换原理 三、代码 一、环境 本文使用环境为&#xff1a; Windows10Python 3.9.17opencv-python 4.8.0.74 二、霍夫变换原理 OpenCV中的霍夫变换是一种用于检测图像中直线和圆的算法。它基于图像中像素的分布情况&#xff0c;通过统计像素点之间的…

纯CSS实现炫酷文本时钟

如图所示这是一个纯本文时钟效果,和传统的时钟不一样,没有表盘,也没有完整到每一分钟的数字表示当前时刻。 在这个时钟中,当前时间通过文本显示,显示的文本时间误差为+/- 4分钟,以明亮的颜色突出显示当前时间,而其余字母则较暗。 实际上这是一个实现很复杂的时钟,因为…

python刷题笔记1(42例题)

1. split()函数 str.split([sep [, maxsplit]]) 分割字符串&#xff0c;返回一个数组 2. 判断子串 # 判断子串是否在主串里面&#xff0c;是则输出“Yes”&#xff0c;否则输出“No” str1 input("子串&#xff1a;") str2 input("主串:") if str1 in s…

Python如何将项目直接打包为一键整合包

目录 一、准备项目 二、创建打包文件 三、创建安装脚本 四、执行安装 五、测试安装 六、常见问题与解决方案 总结 Python项目打包成一键整合包是一个比较复杂的任务&#xff0c;需要考虑到项目的各个方面&#xff0c;包括依赖项、配置文件、静态文件、数据库等等。下面是…

Flask Web开发:数据库

目录 在虚拟环境中安装Flask-SQLAlchemy&#xff1a; 一、配置 数据库配置示例&#xff1a; 二、定义模型 Role 和 User 模型代码&#xff1a; &#xff08;1&#xff09;常用的 SQLAlchemy 列类型&#xff1a;​编辑 &#xff08;2&#xff09;常用的 SQLAlchemy 列选项…

基于springboot实现冬奥会科普平台系统【项目源码+论文说明】计算机毕业设计

基于SpringBoot实现冬奥会科普平台系统演示 摘要 随着信息技术和网络技术的飞速发展&#xff0c;人类已进入全新信息化时代&#xff0c;传统管理技术已无法高效&#xff0c;便捷地管理信息。为了迎合时代需求&#xff0c;优化管理效率&#xff0c;各种各样的管理平台应运而生&…

vue3-响应式核心

​&#x1f308;个人主页&#xff1a;前端青山 &#x1f525;系列专栏&#xff1a;Vue篇 &#x1f516;人终将被年少不可得之物困其一生 依旧青山,本期给大家带来vue篇专栏内容:vue3-响应式核心 响应式核心 目录 响应式核心 3.1ref() 3.2computed () 3.3 reactive() 3.4 …

ESP32 MicroPython AI摄像头应用⑩

ESP32 MicroPython AI摄像头应用⑩ 1、AI摄像头应用2、移动检测&#xff08;LCD显示&#xff09;3、实验内容3、参考代码4、实验结果 1、AI摄像头应用 我们小车MCU支持AI(人工智能)加速&#xff0c;可以用于加速神经网络计算和信号处理等工作的向量指令 (vector instructions)…

一文讲明 网络调试助手的基本使用 NetAssist

我 | 在这里 &#x1f575;️ 读书 | 长沙 ⭐软件工程 ⭐ 本科 &#x1f3e0; 工作 | 广州 ⭐ Java 全栈开发&#xff08;软件工程师&#xff09; &#x1f383; 爱好 | 研究技术、旅游、阅读、运动、喜欢流行歌曲 &#x1f3f7;️ 标签 | 男 自律狂人 目标明确 责任心强 ✈️公…

全球地表水年度数据集JRC Yearly Water Classification History, v1.4数据集

简介&#xff1a; JRC Yearly Water Classification History, v1.4是一个对全球水资源进行分类的数据集&#xff0c;覆盖了1984年至2019年的时间范围。该数据集是由欧盟联合研究中心&#xff08;JRC&#xff09;开发的&#xff0c;使用的数据源是来自Landsat系列卫星的高分辨率…

澳洲猫罐头如何?我亲自喂养过的优质猫罐头分享

猫罐头要符合三点&#xff1a;营养配方完整均衡、原料新鲜优质、生产工艺科学可靠。只有具备这些特点&#xff0c;才是品质上乘的猫罐头。 猫罐头的三个要素&#xff0c;一个都不能少。配方不均衡&#xff0c;营养就不足&#xff1b;原料不新鲜&#xff0c;生产出来的猫罐头就…

NX二次开发UF_CAM_ask_tool_matl_db_object 函数介绍

文章作者&#xff1a;里海 来源网站&#xff1a;里海NX二次开发3000例专栏 UF_CAM_ask_tool_matl_db_object Defined in: uf_cam.h int UF_CAM_ask_tool_matl_db_object(UF_CAM_db_object_t * db_obj ) overview 概述 This function provides the database object which is…

NameServer源码解析

1 模块入口代码的功能 本节介绍入口代码的功能&#xff0c;阅读源码的时候&#xff0c;很多人喜欢根据执行逻辑&#xff0c;先从入口代码看起。NameServer部分入口代码主要完成命令行参数解析&#xff0c;初始化Controller的功能。 1.1 入口函数 首先看一下NameServer的源码目…

长期暴露于空气污染与精神障碍存在因果关系 |UK Biobank周报(11.2)

郑老师统计课程&#xff0c;欢迎点击报名&#xff1a;Nhanes公共数据库挖掘 课程 英国生物银行&#xff08;UK Biobank&#xff0c;UKB&#xff09;是英国迄今以来规模最大的有关致病或预防疾病的基因和环境因子的信息资源库。目的是探求一些特定基因、生活方式和健康状况之间的…

BUUCTF [BJDCTF2020]鸡你太美 1

BUUCTF:https://buuoj.cn/challenges 题目描述&#xff1a; 得到的 flag 请包上 flag{} 提交。来源&#xff1a; https://github.com/BjdsecCA/BJDCTF2020 密文&#xff1a; 下载附件&#xff0c;解压得到两个.gif图片。 第一个gif图片&#xff1a; 第二个gif图片无法打开。…