前言
不从恶人的计谋,不站罪人的道路,不坐亵慢人的座位,惟喜爱耶和华的律法,昼夜思想,这人便为有福!他要像一棵树栽在溪水旁,按时候结果子,叶子也不枯干。凡他所做的尽都顺利。
如何找到孙帅本人
本文内容整理自《孙哥说Dubbo系列视频课程》,老师实力十分雄厚,B站搜孙帅可以找到本人,视频中有老师的微信号。
一:代码结构和术语解释
provider 功能提供者
consumer 功能消费者
commons-api 通用内容 entity+service接口
registry 注册中心
注册中心的作用就是管理provider和consumer的集群的,方便后续的水平拓展。可以进行健康检查,检查provider是否可以正常健康,保证服务提供正常强大的服务。
二:Dubbo直连第一个Provider程序
1:Dubbo通用API和实体编写
@Data
@ToString
@NoArgsConstructor //
@AllArgsConstructor
public class User implements Serializable {
private String name;
private String password;
}
public interface UserService {
public boolean login(String name, String password);
}
2:Dubbo中Provider编写
public class UserServiceImpl implements UserService {
@Override
public boolean login(String name, String password) {
System.out.println("UserServiceImpl.login name " + name + " password " + password);
return false;
}
}
3:Dubbo中Provider配置网络通信
在XML当中配置Dubbo相关标签,保证可以跨虚拟机调用。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">
//给Dubbo应用起个名字
<dubbo:application name="dubbo-02-provider"/>
//指定通信网络协议和通信使用的端口。
//dubbo是Dubbo默认的协议和默认的端口20880
<dubbo:protocol name="dubbo" port="20880"/>
//Spring在Provider当中帮我们创建对象
<bean id="userService" class="com.suns.service.UserServiceImpl"/>
//把这个对象发布成一个Dubbo服务,让Dubbo服务可以调用。ref指向一个对象。
<dubbo:service interface="com.suns.service.UserService" ref="userService"/>
</beans>
两个疑问:
1:为毛第一个不用SpringBoot?
SpringBoot封装的太厉害了。使用SpringBoot封装的太厉害了,我们打个注解就好了,Spring能让我们看到大致的运行过程。
2:两个shema问题
当我们在xml当中预制这个标签的时候,会提示这两个schema标签,我们注意使用dubbo的那个。
3:这个标签的作用
这个标签的作用就是给Dubbo的应用起个名字,我们这个provider是一个Dubbo应用。将来这个名字会被注册中心管理,必须唯一,每一个dubbo的项目,消费者或者生产者都必须得有这个名字。
4:Provider当中创建一个启动类
public class ProviderMain {
public static void main(String[] args) throws InterruptedException {
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext-provider.xml");
applicationContext.start();
//让主线程在这里阻塞。
new CountDownLatch(1).await();
}
}
22:45:01.717 [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@65ae6ba4
22:45:02.507 [main] INFO org.apache.dubbo.rpc.model.FrameworkModel - [DUBBO] Dubbo Framework[1] is created, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.536 [main] INFO org.apache.dubbo.common.resource.GlobalResourcesRepository - [DUBBO] Creating global shared handler ..., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.617 [main] INFO org.apache.dubbo.rpc.model.ApplicationModel - [DUBBO] Dubbo Application[1.0](unknown) is created, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.618 [main] INFO org.apache.dubbo.rpc.model.ScopeModel - [DUBBO] Dubbo Module[1.0.0] is created, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.637 [main] INFO org.apache.dubbo.config.context.AbstractConfigManager - [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.639 [main] INFO org.apache.dubbo.config.context.AbstractConfigManager - [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.655 [main] INFO org.apache.dubbo.common.utils.SerializeSecurityManager - [DUBBO] Serialize check serializable: true, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.656 [main] INFO org.apache.dubbo.common.utils.SerializeSecurityConfigurator - [DUBBO] Read serialize allow list from jar:file:/D:/maven/develop/org/apache/dubbo/dubbo/3.2.0/dubbo-3.2.0.jar!/security/serialize.allowlist, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.678 [main] INFO org.apache.dubbo.common.utils.SerializeSecurityConfigurator - [DUBBO] Read serialize blocked list from jar:file:/D:/maven/develop/org/apache/dubbo/dubbo/3.2.0/dubbo-3.2.0.jar!/security/serialize.blockedlist, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.818 [main] INFO org.apache.dubbo.rpc.model.ApplicationModel - [DUBBO] Dubbo Application[1.1](unknown) is created, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.819 [main] INFO org.apache.dubbo.rpc.model.ScopeModel - [DUBBO] Dubbo Module[1.1.0] is created, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.825 [main] INFO org.apache.dubbo.config.context.AbstractConfigManager - [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.826 [main] INFO org.apache.dubbo.config.context.AbstractConfigManager - [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.828 [main] INFO org.apache.dubbo.common.utils.SerializeSecurityConfigurator - [DUBBO] Read serialize allow list from jar:file:/D:/maven/develop/org/apache/dubbo/dubbo/3.2.0/dubbo-3.2.0.jar!/security/serialize.allowlist, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.829 [main] INFO org.apache.dubbo.common.utils.SerializeSecurityConfigurator - [DUBBO] Read serialize blocked list from jar:file:/D:/maven/develop/org/apache/dubbo/dubbo/3.2.0/dubbo-3.2.0.jar!/security/serialize.blockedlist, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.836 [main] INFO org.apache.dubbo.config.spring.context.DubboSpringInitializer - [DUBBO] Use default application: Dubbo Application[1.1](unknown), dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.837 [main] INFO org.apache.dubbo.rpc.model.ScopeModel - [DUBBO] Dubbo Module[1.1.1] is created, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.838 [main] INFO org.apache.dubbo.config.context.AbstractConfigManager - [DUBBO] Config settings: {dubbo.config.mode=STRICT, dubbo.config.ignore-duplicated-interface=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.839 [main] INFO org.apache.dubbo.common.utils.SerializeSecurityConfigurator - [DUBBO] Read serialize allow list from jar:file:/D:/maven/develop/org/apache/dubbo/dubbo/3.2.0/dubbo-3.2.0.jar!/security/serialize.allowlist, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.840 [main] INFO org.apache.dubbo.common.utils.SerializeSecurityConfigurator - [DUBBO] Read serialize blocked list from jar:file:/D:/maven/develop/org/apache/dubbo/dubbo/3.2.0/dubbo-3.2.0.jar!/security/serialize.blockedlist, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.841 [main] INFO org.apache.dubbo.config.spring.context.DubboSpringInitializer - [DUBBO] Use default module model of target application: Dubbo Module[1.1.1], dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.841 [main] INFO org.apache.dubbo.config.spring.context.DubboSpringInitializer - [DUBBO] Bind Dubbo Module[1.1.1] to spring container: org.springframework.beans.factory.support.DefaultListableBeanFactory@5a8806ef, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:02.842 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.beans.factory.annotation.ServicePackagesHolder]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [dubboServicePackagesHolder] has been registered.
22:45:02.844 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.reference.ReferenceBeanManager]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [dubboReferenceBeanManager] has been registered.
22:45:02.845 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [referenceAnnotationBeanPostProcessor] has been registered.
22:45:02.845 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.beans.factory.annotation.DubboConfigAliasPostProcessor]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [dubboConfigAliasPostProcessor] has been registered.
22:45:02.846 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.context.DubboDeployApplicationListener]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [org.apache.dubbo.config.spring.context.DubboDeployApplicationListener] has been registered.
22:45:02.847 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.context.DubboConfigApplicationListener]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [org.apache.dubbo.config.spring.context.DubboConfigApplicationListener] has been registered.
22:45:02.848 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.beans.factory.config.DubboConfigDefaultPropertyValueBeanPostProcessor]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [dubboConfigDefaultPropertyValueBeanPostProcessor] has been registered.
22:45:02.849 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.context.DubboConfigBeanInitializer]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [dubboConfigBeanInitializer] has been registered.
22:45:02.850 [main] DEBUG org.apache.dubbo.config.spring.util.DubboBeanUtils - The Infrastructure bean definition [Root bean: class [org.apache.dubbo.config.spring.context.DubboInfraBeanRegisterPostProcessor]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=nullwith name [dubboInfraBeanRegisterPostProcessor] has been registered.
22:45:02.861 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loaded 18 bean definitions from class path resource [applicationContext-provider.xml]
22:45:02.878 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
22:45:02.925 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubboConfigAliasPostProcessor'
22:45:02.925 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubboInfraBeanRegisterPostProcessor'
22:45:02.927 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'referenceAnnotationBeanPostProcessor'
22:45:02.929 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubboReferenceBeanManager'
22:45:02.932 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.support.PropertySourcesPlaceholderConfigurer'
22:45:02.968 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
22:45:02.969 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
22:45:03.001 [main] INFO org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor - [DUBBO] class org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.004 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
22:45:03.004 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
22:45:03.007 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubboConfigDefaultPropertyValueBeanPostProcessor'
22:45:03.010 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.apache.dubbo.config.spring.context.DubboConfigApplicationListener'
22:45:03.015 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubboConfigBeanInitializer'
22:45:03.030 [main] INFO org.apache.dubbo.config.spring.context.DubboConfigBeanInitializer - [DUBBO] loading dubbo config beans ..., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.030 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubbo-02-provider'
22:45:03.048 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubbo'
22:45:03.064 [main] INFO org.apache.dubbo.config.spring.context.DubboConfigBeanInitializer - [DUBBO] dubbo config beans are loaded., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.069 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ConfigCenterConfig with prefix [dubbo.config-center], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.074 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ApplicationConfig[id=dubbo-02-provider] with prefix [dubbo.applications.dubbo-02-provider], extracted props: {id=dubbo-02-provider, name=dubbo-02-provider}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.102 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ProtocolConfig[id=dubbo] with prefix [dubbo.protocols.dubbo], extracted props: {name=dubbo, id=dubbo, port=20880}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.110 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing SslConfig with prefix [dubbo.ssl], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.111 [main] INFO org.apache.dubbo.config.context.ConfigManager - [DUBBO] The current configurations or effective configurations are as follows:, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.111 [main] INFO org.apache.dubbo.config.context.ConfigManager - [DUBBO] <dubbo:application enableFileCache="true" executorManagementMode="isolation" parameters="{}" name="dubbo-02-provider" id="dubbo-02-provider" protocol="dubbo" />, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.111 [main] INFO org.apache.dubbo.config.context.ConfigManager - [DUBBO] <dubbo:protocol preferSerialization="fastjson2,hessian2" port="20880" name="dubbo" id="dubbo" />, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.112 [main] INFO org.apache.dubbo.config.context.ConfigManager - [DUBBO] <dubbo:ssl />, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.120 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ProviderConfig with prefix [dubbo.provider], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.126 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ConsumerConfig with prefix [dubbo.consumer], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.129 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ModuleConfig with prefix [dubbo.module], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.130 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ModuleConfig with prefix [dubbo.module], extracted props: {background=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.135 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ProviderConfig with prefix [dubbo.provider], extracted props: {deprecated=false, dynamic=true}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.136 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ConsumerConfig with prefix [dubbo.consumer], extracted props: {sticky=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.137 [main] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.0] has been initialized!, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.142 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ProviderConfig with prefix [dubbo.provider], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.144 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ConsumerConfig with prefix [dubbo.consumer], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.145 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ModuleConfig with prefix [dubbo.module], extracted props: {}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.146 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ModuleConfig with prefix [dubbo.module], extracted props: {background=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.147 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ProviderConfig with prefix [dubbo.provider], extracted props: {deprecated=false, dynamic=true}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.148 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ConsumerConfig with prefix [dubbo.consumer], extracted props: {sticky=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.148 [main] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.1] has been initialized!, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.151 [main] INFO org.apache.dubbo.config.deploy.DefaultApplicationDeployer - [DUBBO] Dubbo Application[1.1](dubbo-02-provider) has been initialized!, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.151 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dubboServicePackagesHolder'
22:45:03.152 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.apache.dubbo.config.spring.context.DubboDeployApplicationListener'
22:45:03.154 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userService'
22:45:03.155 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.apache.dubbo.config.spring.ServiceBean#0'
22:45:03.194 [main] DEBUG org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator - [DUBBO] package org.apache.dubbo.rpc;
import org.apache.dubbo.rpc.model.ScopeModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;
public class Protocol$Adaptive implements org.apache.dubbo.rpc.Protocol {
public void destroy() {
throw new UnsupportedOperationException("The method public abstract void org.apache.dubbo.rpc.Protocol.destroy() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!");
}
public int getDefaultPort() {
throw new UnsupportedOperationException("The method public abstract int org.apache.dubbo.rpc.Protocol.getDefaultPort() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!");
}
public org.apache.dubbo.rpc.Invoker refer(java.lang.Class arg0, org.apache.dubbo.common.URL arg1) throws org.apache.dubbo.rpc.RpcException {
if (arg1 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg1;
String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.Protocol) name from url (" + url.toString() + ") use keys([protocol])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.Protocol.class);
org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName);
return extension.refer(arg0, arg1);
}
public org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker arg0) throws org.apache.dubbo.rpc.RpcException {
if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");
if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");
org.apache.dubbo.common.URL url = arg0.getUrl();
String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.Protocol) name from url (" + url.toString() + ") use keys([protocol])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.Protocol.class);
org.apache.dubbo.rpc.Protocol extension = (org.apache.dubbo.rpc.Protocol)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.Protocol.class).getExtension(extName);
return extension.export(arg0);
}
public java.util.List getServers() {
throw new UnsupportedOperationException("The method public default java.util.List org.apache.dubbo.rpc.Protocol.getServers() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!");
}
}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.311 [main] DEBUG org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator - [DUBBO] package org.apache.dubbo.rpc;
import org.apache.dubbo.rpc.model.ScopeModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;
public class ProxyFactory$Adaptive implements org.apache.dubbo.rpc.ProxyFactory {
public org.apache.dubbo.rpc.Invoker getInvoker(java.lang.Object arg0, java.lang.Class arg1, org.apache.dubbo.common.URL arg2) throws org.apache.dubbo.rpc.RpcException {
if (arg2 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg2;
String extName = url.getParameter("proxy", "javassist");
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url (" + url.toString() + ") use keys([proxy])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.ProxyFactory.class);
org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName);
return extension.getInvoker(arg0, arg1, arg2);
}
public java.lang.Object getProxy(org.apache.dubbo.rpc.Invoker arg0, boolean arg1) throws org.apache.dubbo.rpc.RpcException {
if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");
if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");
org.apache.dubbo.common.URL url = arg0.getUrl();
String extName = url.getParameter("proxy", "javassist");
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url (" + url.toString() + ") use keys([proxy])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.ProxyFactory.class);
org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName);
return extension.getProxy(arg0, arg1);
}
public java.lang.Object getProxy(org.apache.dubbo.rpc.Invoker arg0) throws org.apache.dubbo.rpc.RpcException {
if (arg0 == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");
if (arg0.getUrl() == null) throw new IllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");
org.apache.dubbo.common.URL url = arg0.getUrl();
String extName = url.getParameter("proxy", "javassist");
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url (" + url.toString() + ") use keys([proxy])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.rpc.ProxyFactory.class);
org.apache.dubbo.rpc.ProxyFactory extension = (org.apache.dubbo.rpc.ProxyFactory)scopeModel.getExtensionLoader(org.apache.dubbo.rpc.ProxyFactory.class).getExtension(extName);
return extension.getProxy(arg0);
}
}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.359 [main] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.1] is starting., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.360 [main] INFO org.apache.dubbo.config.deploy.DefaultApplicationDeployer - [DUBBO] Dubbo Application[1.1](dubbo-02-provider) is starting., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.361 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ServiceBean with prefix [dubbo.service], extracted props: {path=com.suns.service.UserService, interface=com.suns.service.UserService, deprecated=false, dynamic=true}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.362 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ServiceBean with prefix [dubbo.service.com.suns.service.UserService], extracted props: {interface=com.suns.service.UserService, path=com.suns.service.UserService, dynamic=true, deprecated=false}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.409 [main] DEBUG org.apache.dubbo.config.ServiceConfig - [DUBBO] No valid ip found from environment, try to get local host., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.958 [main] DEBUG org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator - [DUBBO] package org.apache.dubbo.monitor;
import org.apache.dubbo.rpc.model.ScopeModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;
public class MonitorFactory$Adaptive implements org.apache.dubbo.monitor.MonitorFactory {
public org.apache.dubbo.monitor.Monitor getMonitor(org.apache.dubbo.common.URL arg0) {
if (arg0 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg0;
String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.monitor.MonitorFactory) name from url (" + url.toString() + ") use keys([protocol])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.monitor.MonitorFactory.class);
org.apache.dubbo.monitor.MonitorFactory extension = (org.apache.dubbo.monitor.MonitorFactory)scopeModel.getExtensionLoader(org.apache.dubbo.monitor.MonitorFactory.class).getExtension(extName);
return extension.getMonitor(arg0);
}
}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:03.975 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
22:45:03.988 [main] DEBUG io.netty.channel.MultithreadEventLoopGroup - -Dio.netty.eventLoopThreads: 16
22:45:03.995 [main] DEBUG io.netty.util.concurrent.GlobalEventExecutor - -Dio.netty.globalEventExecutor.quietPeriodSeconds: 1
22:45:04.000 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
22:45:04.000 [main] DEBUG io.netty.util.internal.InternalThreadLocalMap - -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
22:45:04.011 [main] DEBUG io.netty.util.internal.PlatformDependent0 - -Dio.netty.noUnsafe: false
22:45:04.013 [main] DEBUG io.netty.util.internal.PlatformDependent0 - Java version: 8
22:45:04.013 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.theUnsafe: available
22:45:04.013 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.copyMemory: available
22:45:04.013 [main] DEBUG io.netty.util.internal.PlatformDependent0 - sun.misc.Unsafe.storeFence: available
22:45:04.013 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Buffer.address: available
22:45:04.013 [main] DEBUG io.netty.util.internal.PlatformDependent0 - direct buffer constructor: available
22:45:04.014 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.Bits.unaligned: available, true
22:45:04.014 [main] DEBUG io.netty.util.internal.PlatformDependent0 - jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable prior to Java9
22:45:04.014 [main] DEBUG io.netty.util.internal.PlatformDependent0 - java.nio.DirectByteBuffer.<init>(long, int): available
22:45:04.014 [main] DEBUG io.netty.util.internal.PlatformDependent - sun.misc.Unsafe: available
22:45:04.014 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.tmpdir: C:\Users\ADMINI~1\AppData\Local\Temp (java.io.tmpdir)
22:45:04.014 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.bitMode: 64 (sun.arch.data.model)
22:45:04.014 [main] DEBUG io.netty.util.internal.PlatformDependent - Platform: Windows
22:45:04.015 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.maxDirectMemory: 3771203584 bytes
22:45:04.015 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.uninitializedArrayAllocationThreshold: -1
22:45:04.015 [main] DEBUG io.netty.util.internal.CleanerJava6 - java.nio.ByteBuffer.cleaner(): available
22:45:04.015 [main] DEBUG io.netty.util.internal.PlatformDependent - -Dio.netty.noPreferDirect: false
22:45:04.016 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.noKeySetOptimization: false
22:45:04.016 [main] DEBUG io.netty.channel.nio.NioEventLoop - -Dio.netty.selectorAutoRebuildThreshold: 512
22:45:04.020 [main] DEBUG io.netty.util.internal.PlatformDependent - org.jctools-core.MpscChunkedArrayQueue: available
22:45:04.288 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.processId: 11488 (auto-detected)
22:45:04.290 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false
22:45:04.290 [main] DEBUG io.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false
22:45:04.486 [main] DEBUG io.netty.util.NetUtilInitializations - Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1)
22:45:04.488 [main] DEBUG io.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200
22:45:04.509 [main] DEBUG io.netty.channel.DefaultChannelId - -Dio.netty.machineId: 00:50:56:ff:fe:c0:00:08 (auto-detected)
22:45:04.517 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.level: simple
22:45:04.517 [main] DEBUG io.netty.util.ResourceLeakDetector - -Dio.netty.leakDetection.targetRecords: 4
22:45:04.532 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numHeapArenas: 16
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.numDirectArenas: 16
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.pageSize: 8192
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxOrder: 9
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.chunkSize: 4194304
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.smallCacheSize: 256
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.normalCacheSize: 64
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedBufferCapacity: 32768
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimInterval: 8192
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.cacheTrimIntervalMillis: 0
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.useCacheForAllThreads: false
22:45:04.534 [main] DEBUG io.netty.buffer.PooledByteBufAllocator - -Dio.netty.allocator.maxCachedByteBuffersPerChunk: 1023
22:45:04.540 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.allocator.type: pooled
22:45:04.540 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.threadLocalDirectBufferSize: 0
22:45:04.540 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
22:45:04.549 [main] INFO org.apache.dubbo.qos.server.Server - [DUBBO] qos-server bind localhost:22222, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.559 [main] INFO org.apache.dubbo.config.ServiceConfig - [DUBBO] Export dubbo service com.suns.service.UserService to local registry url : injvm://127.0.0.1/com.suns.service.UserService?anyhost=true&application=dubbo-02-provider&background=false&bind.ip=192.168.8.1&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&executor-management-mode=isolation&exporter.listener=injvm&file-cache=true&generic=false&interface=com.suns.service.UserService&methods=login&pid=11488&prefer.serialization=fastjson2,hessian2&release=3.2.0&side=provider×tamp=1689000303403, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.559 [main] INFO org.apache.dubbo.config.ServiceConfig - [DUBBO] Export dubbo service com.suns.service.UserService to url dubbo://192.168.8.1:20880/com.suns.service.UserService?anyhost=true&application=dubbo-02-provider&background=false&bind.ip=192.168.8.1&bind.port=20880&deprecated=false&dubbo=2.0.2&dynamic=true&executor-management-mode=isolation&file-cache=true&generic=false&interface=com.suns.service.UserService&methods=login&pid=11488&prefer.serialization=fastjson2,hessian2&release=3.2.0&side=provider×tamp=1689000303403, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.572 [main] DEBUG org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator - [DUBBO] package org.apache.dubbo.remoting;
import org.apache.dubbo.rpc.model.ScopeModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;
public class Transporter$Adaptive implements org.apache.dubbo.remoting.Transporter {
public org.apache.dubbo.remoting.Client connect(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException {
if (arg0 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg0;
String extName = url.getParameter("client", url.getParameter("transporter", "netty"));
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Transporter) name from url (" + url.toString() + ") use keys([client, transporter])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Transporter.class);
org.apache.dubbo.remoting.Transporter extension = (org.apache.dubbo.remoting.Transporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Transporter.class).getExtension(extName);
return extension.connect(arg0, arg1);
}
public org.apache.dubbo.remoting.RemotingServer bind(org.apache.dubbo.common.URL arg0, org.apache.dubbo.remoting.ChannelHandler arg1) throws org.apache.dubbo.remoting.RemotingException {
if (arg0 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg0;
String extName = url.getParameter("server", url.getParameter("transporter", "netty"));
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Transporter) name from url (" + url.toString() + ") use keys([server, transporter])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Transporter.class);
org.apache.dubbo.remoting.Transporter extension = (org.apache.dubbo.remoting.Transporter)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Transporter.class).getExtension(extName);
return extension.bind(arg0, arg1);
}
}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.588 [main] DEBUG org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator - [DUBBO] package org.apache.dubbo.remoting;
import org.apache.dubbo.rpc.model.ScopeModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;
public class Dispatcher$Adaptive implements org.apache.dubbo.remoting.Dispatcher {
public org.apache.dubbo.remoting.ChannelHandler dispatch(org.apache.dubbo.remoting.ChannelHandler arg0, org.apache.dubbo.common.URL arg1) {
if (arg1 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg1;
String extName = url.getParameter("dispatcher", url.getParameter("dispather", url.getParameter("channel.handler", "all")));
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Dispatcher) name from url (" + url.toString() + ") use keys([dispatcher, dispather, channel.handler])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.remoting.Dispatcher.class);
org.apache.dubbo.remoting.Dispatcher extension = (org.apache.dubbo.remoting.Dispatcher)scopeModel.getExtensionLoader(org.apache.dubbo.remoting.Dispatcher.class).getExtension(extName);
return extension.dispatch(arg0, arg1);
}
}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.618 [main] INFO org.apache.dubbo.remoting.transport.AbstractServer - [DUBBO] Start NettyServer bind /0.0.0.0:20880, export /192.168.8.1:20880, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.623 [main] DEBUG org.apache.dubbo.common.extension.AdaptiveClassCodeGenerator - [DUBBO] package org.apache.dubbo.common.threadpool;
import org.apache.dubbo.rpc.model.ScopeModel;
import org.apache.dubbo.rpc.model.ScopeModelUtil;
public class ThreadPool$Adaptive implements org.apache.dubbo.common.threadpool.ThreadPool {
public java.util.concurrent.Executor getExecutor(org.apache.dubbo.common.URL arg0) {
if (arg0 == null) throw new IllegalArgumentException("url == null");
org.apache.dubbo.common.URL url = arg0;
String extName = url.getParameter("threadpool", "fixed");
if(extName == null) throw new IllegalStateException("Failed to get extension (org.apache.dubbo.common.threadpool.ThreadPool) name from url (" + url.toString() + ") use keys([threadpool])");
ScopeModel scopeModel = ScopeModelUtil.getOrDefault(url.getScopeModel(), org.apache.dubbo.common.threadpool.ThreadPool.class);
org.apache.dubbo.common.threadpool.ThreadPool extension = (org.apache.dubbo.common.threadpool.ThreadPool)scopeModel.getExtensionLoader(org.apache.dubbo.common.threadpool.ThreadPool.class).getExtension(extName);
return extension.getExecutor(arg0);
}
}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.630 [main] WARN org.apache.dubbo.registry.client.metadata.MetadataUtils - [DUBBO] Remote Metadata Report Server is not provided or unavailable, will stop registering service definition to remote center!, dubbo version: 3.2.0, current host: 192.168.8.1, error code: 1-39. This may be caused by , go to https://dubbo.apache.org/faq/1/39 to find instructions.
22:45:04.631 [main] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.0] is starting., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.631 [main] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.0] has started., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.631 [main] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.1] has started., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.631 [main] INFO org.apache.dubbo.config.deploy.DefaultMetricsServiceExporter - [DUBBO] The MetricsConfig not exist, will not export metrics service., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.635 [main] INFO org.apache.dubbo.config.bootstrap.builders.InternalServiceConfigBuilder - [DUBBO] org.apache.dubbo.metadata.MetadataServiceService Port hasn't been set will use default protocol defined in protocols., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.636 [main] INFO org.apache.dubbo.config.bootstrap.builders.InternalServiceConfigBuilder - [DUBBO] Using dubbo protocol to export org.apache.dubbo.metadata.MetadataService service on port 20880, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.642 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ServiceConfig with prefix [dubbo.service], extracted props: {group=dubbo-02-provider, register=false, interface=org.apache.dubbo.metadata.MetadataService, deprecated=false, dynamic=true, version=1.0.0, delay=0}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.648 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing MethodConfig[name=getAndListenInstanceMetadata] with prefix [dubbo.service.getAndListenInstanceMetadata], extracted props: {name=getAndListenInstanceMetadata}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.651 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing ServiceConfig with prefix [dubbo.service.org.apache.dubbo.metadata.MetadataService], extracted props: {version=1.0.0, interface=org.apache.dubbo.metadata.MetadataService, deprecated=false, group=dubbo-02-provider, register=false, dynamic=true, delay=0}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.653 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing MethodConfig[name=getAndListenInstanceMetadata] with prefix [dubbo.service.org.apache.dubbo.metadata.MetadataService.getAndListenInstanceMetadata], extracted props: {sent=true, name=getAndListenInstanceMetadata, return=true}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.657 [main] DEBUG org.apache.dubbo.config.AbstractConfig - [DUBBO] Refreshing RegistryConfig[id=internal-metadata-registry] with prefix [dubbo.registries.internal-metadata-registry], extracted props: {port=0, id=internal-metadata-registry, address=N/A}, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.662 [main] DEBUG org.apache.dubbo.config.ServiceConfig - [DUBBO] No valid ip found from environment, try to get local host., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.685 [main] INFO org.apache.dubbo.config.ServiceConfig - [DUBBO] Export dubbo service org.apache.dubbo.metadata.MetadataService to local registry url : injvm://127.0.0.1/org.apache.dubbo.metadata.MetadataService?anyhost=true&application=dubbo-02-provider&background=false&bind.ip=192.168.8.1&bind.port=20880&delay=0&deprecated=false&dubbo=2.0.2&dynamic=true&executor-management-mode=isolation&exporter.listener=injvm&file-cache=true&generic=false&getAndListenInstanceMetadata.1.callback=true&getAndListenInstanceMetadata.return=true&getAndListenInstanceMetadata.sent=true&group=dubbo-02-provider&interface=org.apache.dubbo.metadata.MetadataService&methods=exportInstanceMetadata,getAndListenInstanceMetadata,getExportedServiceURLs,getExportedURLs,getExportedURLs,getExportedURLs,getExportedURLs,getExportedURLs,getInstanceMetadataChangedListenerMap,getMetadataInfo,getMetadataInfos,getMetadataURL,getServiceDefinition,getServiceDefinition,getSubscribedURLs,isMetadataService,serviceName,toSortedStrings,toSortedStrings,version&pid=11488&prefer.serialization=fastjson2,hessian2®ister=false&release=3.2.0&revision=3.2.0&side=provider×tamp=1689000304658&version=1.0.0, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.685 [main] INFO org.apache.dubbo.config.ServiceConfig - [DUBBO] Export dubbo service org.apache.dubbo.metadata.MetadataService to url dubbo://192.168.8.1:20880/org.apache.dubbo.metadata.MetadataService?anyhost=true&application=dubbo-02-provider&background=false&bind.ip=192.168.8.1&bind.port=20880&delay=0&deprecated=false&dubbo=2.0.2&dynamic=true&executor-management-mode=isolation&file-cache=true&generic=false&getAndListenInstanceMetadata.1.callback=true&getAndListenInstanceMetadata.return=true&getAndListenInstanceMetadata.sent=true&group=dubbo-02-provider&interface=org.apache.dubbo.metadata.MetadataService&methods=exportInstanceMetadata,getAndListenInstanceMetadata,getExportedServiceURLs,getExportedURLs,getExportedURLs,getExportedURLs,getExportedURLs,getExportedURLs,getInstanceMetadataChangedListenerMap,getMetadataInfo,getMetadataInfos,getMetadataURL,getServiceDefinition,getServiceDefinition,getSubscribedURLs,isMetadataService,serviceName,toSortedStrings,toSortedStrings,version&pid=11488&prefer.serialization=fastjson2,hessian2®ister=false&release=3.2.0&revision=3.2.0&side=provider×tamp=1689000304658&version=1.0.0, dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.688 [main] INFO org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter - [DUBBO] The MetadataService exports urls : [dubbo://192.168.8.1:20880/org.apache.dubbo.metadata.MetadataService?anyhost=true&application=dubbo-02-provider&background=false&bind.ip=192.168.8.1&bind.port=20880&delay=0&deprecated=false&dubbo=2.0.2&dynamic=true&executor-management-mode=isolation&file-cache=true&generic=false&getAndListenInstanceMetadata.1.callback=true&getAndListenInstanceMetadata.return=true&getAndListenInstanceMetadata.sent=true&group=dubbo-02-provider&interface=org.apache.dubbo.metadata.MetadataService&methods=exportInstanceMetadata,getAndListenInstanceMetadata,getExportedServiceURLs,getExportedURLs,getExportedURLs,getExportedURLs,getExportedURLs,getExportedURLs,getInstanceMetadataChangedListenerMap,getMetadataInfo,getMetadataInfos,getMetadataURL,getServiceDefinition,getServiceDefinition,getSubscribedURLs,isMetadataService,serviceName,toSortedStrings,toSortedStrings,version&pid=11488&prefer.serialization=fastjson2,hessian2®ister=false&release=3.2.0&revision=3.2.0&side=provider×tamp=1689000304658&version=1.0.0], dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.690 [main] INFO org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils - [DUBBO] Start registering instance address to registry., dubbo version: 3.2.0, current host: 192.168.8.1
22:45:04.695 [main] INFO org.apache.dubbo.config.deploy.DefaultApplicationDeployer - [DUBBO] Dubbo Application[1.1](dubbo-02-provider) is ready., dubbo version: 3.2.0, current host: 192.168.8.1
最核心的是最后一行,最后一行一出现,代表我们的Dubbo服务一定启动好,可以对外提供服务了
关键日志分析:
22:45:04.559 [main] INFO org.apache.dubbo.config.ServiceConfig - [DUBBO] Export dubbo service com.suns.service.UserService to url dubbo://192.168.8.1:20880/com.suns.service.UserService
Export 导出、暴露 Dubbo服务这个接口到如下的URL地址:dubbo是协议名:ip端口号,后边是具体的接口地址。
Provider开发到此结束。