【六祎 - 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.xsdhttp://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.xsdhttp://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"/><!--dubboreference:声明普通接口为 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>

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

人工智能AI 全栈体系(十三)

第二章 计算机是如何学会下棋的 人类棋手在下棋时&#xff0c;会根据自己的经验只考虑在当前棋局下最重要的几个可能的走法&#xff0c;但是计算机没有这种经验。 知识太复杂了&#xff0c;需要考虑很多具体的情况&#xff0c;一旦知识总结的不到位&#xff0c;可能就会出现大…

#gStore-weekly | gBuilder功能详解之表单录入

gBuilder除了可以提供结构化数据映射以及非结构化数据抽取两种构建知识图谱的方式以外&#xff0c;还提供了表单录入的方式来构建知识图谱的数据&#xff0c;用户只需要根据设计好的schema将实体、属性以及关系通过填写表单的形式录入&#xff0c;再通过一键生成NT文件即可获得…

酷开科技丨这么好用的酷开系统,不用真的会后悔!

掀开一幕幕精彩剧情&#xff0c;手机已经成为了我们身边必不可少的追剧神器。在这个信息爆炸的时代&#xff0c;我们渴望能够随时随地享受到精彩的影视作品&#xff0c;尤其是在家的休息的时候&#xff0c;希望电视也能同手机一样&#xff0c;想看啥就搜啥。酷开科技大内容战略…

系列五、线程间通信

一、synchronized实现 1.1、案例一&#xff08;2个线程交替对变量执行1、-1操作&#xff0c;来10轮&#xff09; 1.1.1、资源类ShareDataOne /*** Author : 一叶浮萍归大海* Date: 2023/11/20 10:44* Description: 资源类* 说明&#xff1a;2个线程使用if判断变量的值&#…

Linux 信号

目录 1.什么是信号 2.信号的产生 处理信号的常见方式&#xff1a; 如何理解这些组合键是如何变成信号的&#xff1f; 信号发送本质​编辑 信号的种类 ​编辑 3.信号处理常见方式概览 4.产生信号 5.信号其他相关常见概念 ​编辑 6.捕捉信号 signal函数&#xff1a; …

【Go语言实战】(26) 分布式搜索引擎

Tangseng 基于Go语言的搜索引擎 github地址&#xff1a;https://github.com/CocaineCong/tangseng 详细介绍地址&#xff1a;https://cocainecong.github.io/tangseng 这两周我也抽空录成视频发到B站的&#xff5e; 本来应该10月份就要发了&#xff0c;结果一鸽就鸽到现在hh…

Conditional GAN

Text-to-Image 对于根据文字生成图像的问题&#xff0c;传统的做法就是训练一个NN&#xff0c;然后输入一段文字&#xff0c;输出对应一个图片&#xff0c;输出图片与目标图片越接近越好。存在的问题就是&#xff0c;比如火车对应的图片有很多张&#xff0c;如果用传统的NN来训…

shell编脚本概述和变量解释

shell的基本概述和规范 shell面向的对象 面向过程语言 &#xff08;开发的时候&#xff0c;需要一步一步的执行&#xff09; 做一件事情&#xff0c;排出个步骤&#xff0c;第一步干什么&#xff0c;第二步干什么&#xff0c;如果出现情况A&#xff0c;做什么处理&#xff0…

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

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

NX二次开发UF_CAM_ask_lower_limit_plane_data 函数介绍

文章作者&#xff1a;里海 来源网站&#xff1a;里海NX二次开发3000例专栏 UF_CAM_ask_lower_limit_plane_data Defined in: uf_cam_planes.h int UF_CAM_ask_lower_limit_plane_data(tag_t object_tag, double origin [ 3 ] , double normal [ 3 ] ) overview 概述 Query …

鸿蒙开发|鸿蒙系统项目开发前的准备工作

文章目录 鸿蒙项目开发的基本流程介绍鸿蒙项目开发和其他项目有什么不同成为华为开发者-注册和实名认证1.登录官方网站 鸿蒙项目开发的基本流程介绍 直接上图&#xff0c;简单易懂&#xff01; 整个项目的开发通过4个模块进行&#xff1a;开发准备、开发应用、运行调试测试和发…

关于使用宝塔页面Nginx的一些注意事项:Nginx不生效情况,以及解决方案

判断Nginx是否正常运行 使用宝塔页面保存Nginx配置后&#xff0c;有的时候不生效&#xff0c;这就说明Nginx没有正常运行 可以通过以下几种方式排查 通过宝塔 如果能够打开负载状态&#xff0c;说明Nginx运行正常 如果打不开&#xff0c;说明肯定是配置文件或者什么导致ngi…

NameServer源码解析

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

代码随想录算法训练营第五十九天丨 单调栈02

503.下一个更大元素II 思路 做本题之前建议先做739. 每日温度 (opens new window)和 496.下一个更大元素 I (opens new window)。 这道题和739. 每日温度 (opens new window)也几乎如出一辙。 不过&#xff0c;本题要循环数组了。 关于单调栈的讲解我在题解739. 每日温度 …

el-table 对循环产生的空白列赋默认值

1. el-table 空白列赋值 对el-table中未传数据存在空白的列赋默认值0。使用el-table 提供的插槽 slot-scope&#xff1a;{{ row || ‘0’ }} 原数据&#xff1a; <el-table-column label"集镇" :propcity ><template slot-scope"{row}">{{…

Vue实现表单效验

第一步&#xff1a;首先给form表单绑定一个rules属性 和 ref属性 <el-form :model"addFroms" label-position"right" :rules"rules" ref"ruleFormRef" label-width"100px"></el-form> 第二步&#xff1a;获取表…

TCC简介

TCC TCC&#xff08;Try-Confirm/Cancel&#xff09;是一种分布式事务处理模型&#xff0c;旨在解决分布式系统中的事务一致性问题。 三阶段 Try阶段&#xff1a; 在这个阶段&#xff0c;业务参与者尝试执行事务&#xff0c;并执行相应的业务逻辑。该阶段用于检查事务执行的…

007 OpenCV霍夫变换

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

2024年山东省职业院校技能大赛中职组“网络安全”赛项竞赛试题-C

2024年山东省职业院校技能大赛中职组 “网络安全”赛项竞赛试题-C 一、竞赛时间 总计&#xff1a;360分钟 二、竞赛阶段 竞赛阶段 任务阶段 竞赛任务 竞赛时间 分值 A、B模块 A-1 登录安全加固 180分钟 200分 A-2 本地安全策略设置 A-3 流量完整性保护 A-4 …