From 4204be7b28484944907d73f23f191d89964dcdbb Mon Sep 17 00:00:00 2001 From: "ken.lj" Date: Tue, 15 Sep 2020 18:50:22 +0800 Subject: [PATCH] add logger to critical path (#6744) --- .../config/bootstrap/DubboBootstrap.java | 7 +++ .../client/ServiceDiscoveryRegistry.java | 7 ++- .../ServiceInstancesChangedListener.java | 9 +++ .../store/RemoteMetadataServiceImpl.java | 4 ++ .../DefaultMigrationAddressComparator.java | 4 ++ .../client/migration/MigrationInvoker.java | 63 +++++++++++++++---- .../migration/MigrationRuleListener.java | 7 ++- .../ServiceDiscoveryMigrationInvoker.java | 4 +- .../InterfaceCompatibleRegistryProtocol.java | 4 +- .../integration/RegistryProtocol.java | 19 +++--- .../integration/RegistryProtocolListener.java | 3 +- 11 files changed, 102 insertions(+), 29 deletions(-) diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java index 34977b3757..9aa34557a8 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java @@ -1173,11 +1173,18 @@ public class DubboBootstrap extends GenericEventListener { private void doRegisterServiceInstance(ServiceInstance serviceInstance) { //FIXME + if (logger.isInfoEnabled()) { + logger.info("Start publishing metadata to remote center, this only makes sense for applications enabled remote metadata center."); + } publishMetadataToRemote(serviceInstance); + logger.info("Start registering instance address to registry."); getServiceDiscoveries().forEach(serviceDiscovery -> { calInstanceRevision(serviceDiscovery, serviceInstance); + if (logger.isDebugEnabled()) { + logger.info("Start registering instance address to registry" + serviceDiscovery.getUrl() + ", instance " + serviceInstance); + } // register metadata serviceDiscovery.register(serviceInstance); }); diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java index 35f18ce165..f3cc97358e 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistry.java @@ -260,6 +260,7 @@ public class ServiceDiscoveryRegistry implements Registry { writableMetadataService.subscribeURL(url); Set serviceNames = getServices(url, listener); + if (CollectionUtils.isEmpty(serviceNames)) { throw new IllegalStateException("Should has at least one way to know which services this interface belongs to, subscription url: " + url); } @@ -363,12 +364,16 @@ public class ServiceDiscoveryRegistry implements Registry { String serviceNames = subscribedURL.getParameter(PROVIDED_BY); if (StringUtils.isNotEmpty(serviceNames)) { + logger.info(subscribedURL.getServiceInterface() + " mapping to " + serviceNames + " instructed by provided-by set by user."); subscribedServices.addAll(parseServices(serviceNames)); } if (isEmpty(subscribedServices)) { - subscribedServices.addAll(findMappedServices(subscribedURL, new DefaultMappingListener(subscribedURL, subscribedServices, listener))); + Set mappedServices = findMappedServices(subscribedURL, new DefaultMappingListener(subscribedURL, subscribedServices, listener)); + logger.info(subscribedURL.getServiceInterface() + " mapping to " + serviceNames + " instructed by remote metadata center."); + subscribedServices.addAll(mappedServices); if (isEmpty(subscribedServices)) { + logger.info(subscribedURL.getServiceInterface() + " mapping to " + serviceNames + " by default."); subscribedServices.addAll(getSubscribedServices()); } } diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java index c412547cff..87e0977311 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/event/listener/ServiceInstancesChangedListener.java @@ -88,6 +88,9 @@ public class ServiceInstancesChangedListener implements ConditionalEventListener logger.info("Received instance notification, serviceName: " + event.getServiceName() + ", instances: " + event.getServiceInstances().size()); String appName = event.getServiceName(); allInstances.put(appName, event.getServiceInstances()); + if (logger.isDebugEnabled()) { + logger.debug(event.getServiceInstances().toString()); + } Map> revisionToInstances = new HashMap<>(); Map> localServiceToRevisions = new HashMap<>(); @@ -161,6 +164,9 @@ public class ServiceInstancesChangedListener implements ConditionalEventListener instance.getExtendParams().putIfAbsent(REGISTRY_CLUSTER_KEY, RegistryClusterIdentifier.getExtension(url).consumerKey(url)); MetadataInfo metadataInfo; try { + if (logger.isDebugEnabled()) { + logger.info("Instance " + instance.getAddress() + " is using metadata type " + metadataType); + } if (REMOTE_METADATA_STORAGE_TYPE.equals(metadataType)) { RemoteMetadataServiceImpl remoteMetadataService = MetadataUtils.getRemoteMetadataService(); metadataInfo = remoteMetadataService.getMetadata(instance); @@ -168,6 +174,9 @@ public class ServiceInstancesChangedListener implements ConditionalEventListener MetadataService metadataServiceProxy = MetadataUtils.getMetadataServiceProxy(instance, serviceDiscovery); metadataInfo = metadataServiceProxy.getMetadataInfo(ServiceInstanceMetadataUtils.getExportedServicesRevision(instance)); } + if (logger.isDebugEnabled()) { + logger.info("Metadata " + metadataInfo.toString()); + } } catch (Exception e) { logger.error("Failed to load service metadata, metadta type is " + metadataType, e); metadataInfo = null; diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/store/RemoteMetadataServiceImpl.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/store/RemoteMetadataServiceImpl.java index 01c4effe63..209a9fab9e 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/store/RemoteMetadataServiceImpl.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/store/RemoteMetadataServiceImpl.java @@ -69,6 +69,10 @@ public class RemoteMetadataServiceImpl { if (metadataReport == null) { metadataReport = getMetadataReports().entrySet().iterator().next().getValue(); } + logger.info("Publishing metadata to " + metadataReport.getClass().getSimpleName()); + if (logger.isDebugEnabled()) { + logger.debug(metadataInfo.toString()); + } metadataReport.publishAppMetadata(identifier, metadataInfo); metadataInfo.markReported(); } diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/DefaultMigrationAddressComparator.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/DefaultMigrationAddressComparator.java index b13ac275d5..81c93d364d 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/DefaultMigrationAddressComparator.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/DefaultMigrationAddressComparator.java @@ -34,9 +34,11 @@ public class DefaultMigrationAddressComparator implements MigrationAddressCompar @Override public boolean shouldMigrate(ClusterInvoker serviceDiscoveryInvoker, ClusterInvoker invoker) { if (!serviceDiscoveryInvoker.isAvailable()) { + logger.info("No instance address available, will not migrate."); return false; } if (!invoker.isAvailable()) { + logger.info("No interface address available, will migrate."); return true; } @@ -55,6 +57,8 @@ public class DefaultMigrationAddressComparator implements MigrationAddressCompar threshold = DEFAULT_THREAD; } + logger.info("Instance address size " + newAddressSize + ", interface address size " + oldAddressSize + ", threshold " + threshold); + if (newAddressSize != 0 && oldAddressSize == 0) { return true; } diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java index e82d1644c5..c95dc88185 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationInvoker.java @@ -18,6 +18,8 @@ package org.apache.dubbo.registry.client.migration; import org.apache.dubbo.common.URL; import org.apache.dubbo.common.extension.ExtensionLoader; +import org.apache.dubbo.common.logger.Logger; +import org.apache.dubbo.common.logger.LoggerFactory; import org.apache.dubbo.common.utils.StringUtils; import org.apache.dubbo.registry.Registry; import org.apache.dubbo.registry.client.migration.model.MigrationStep; @@ -35,8 +37,10 @@ import java.util.Set; import static org.apache.dubbo.rpc.cluster.Constants.REFER_KEY; public class MigrationInvoker implements MigrationClusterInvoker { + private Logger logger = LoggerFactory.getLogger(MigrationInvoker.class); private URL url; + private URL consumerUrl; private Cluster cluster; private Registry registry; private Class type; @@ -50,8 +54,9 @@ public class MigrationInvoker implements MigrationClusterInvoker { Cluster cluster, Registry registry, Class type, - URL url) { - this(null, null, registryProtocol, cluster, registry, type, url); + URL url, + URL consumerUrl) { + this(null, null, registryProtocol, cluster, registry, type, url, consumerUrl); } public MigrationInvoker(ClusterInvoker invoker, @@ -60,7 +65,8 @@ public class MigrationInvoker implements MigrationClusterInvoker { Cluster cluster, Registry registry, Class type, - URL url) { + URL url, + URL consumerUrl) { this.invoker = invoker; this.serviceDiscoveryInvoker = serviceDiscoveryInvoker; this.registryProtocol = registryProtocol; @@ -68,6 +74,7 @@ public class MigrationInvoker implements MigrationClusterInvoker { this.registry = registry; this.type = type; this.url = url; + this.consumerUrl = consumerUrl; } public ClusterInvoker getInvoker() { @@ -142,24 +149,18 @@ public class MigrationInvoker implements MigrationClusterInvoker { @Override public Result invoke(Invocation invocation) throws RpcException { if (!checkInvokerAvailable(serviceDiscoveryInvoker)) { + logger.debug("Using interface addresses to handle invocation, interface " + type.getName() + ", total address size " + invoker.getDirectory().getAllInvokers().size()); return invoker.invoke(invocation); } if (!checkInvokerAvailable(invoker)) { + logger.debug("Using instance addresses to handle invocation, interface " + type.getName() + ", total address size " + serviceDiscoveryInvoker.getDirectory().getAllInvokers().size()); return serviceDiscoveryInvoker.invoke(invocation); } return currentAvailableInvoker.invoke(invocation); } - @Override - public URL getUrl() { - if (invoker != null) { - return invoker.getUrl(); - } - return serviceDiscoveryInvoker.getUrl(); - } - @Override public boolean isAvailable() { return (invoker != null && invoker.isAvailable()) @@ -176,20 +177,35 @@ public class MigrationInvoker implements MigrationClusterInvoker { } } + @Override + public URL getUrl() { + if (invoker != null) { + return invoker.getUrl(); + } else if (serviceDiscoveryInvoker != null) { + return serviceDiscoveryInvoker.getUrl(); + } + + return consumerUrl; + } + @Override public URL getRegistryUrl() { if (invoker != null) { return invoker.getRegistryUrl(); + } else if (serviceDiscoveryInvoker != null) { + serviceDiscoveryInvoker.getRegistryUrl(); } - return serviceDiscoveryInvoker.getRegistryUrl(); + return url; } @Override public Directory getDirectory() { if (invoker != null) { return invoker.getDirectory(); + } else if (serviceDiscoveryInvoker != null) { + return serviceDiscoveryInvoker.getDirectory(); } - return serviceDiscoveryInvoker.getDirectory(); + return null; } @Override @@ -217,6 +233,9 @@ public class MigrationInvoker implements MigrationClusterInvoker { private synchronized void compareAddresses() { this.invokersChanged = true; + if (logger.isDebugEnabled()) { + logger.info("" + invoker.getDirectory().getAllInvokers().size()); + } Set detectors = ExtensionLoader.getExtensionLoader(MigrationAddressComparator.class).getSupportedExtensionInstances(); if (detectors != null && detectors.stream().allMatch(migrationDetector -> migrationDetector.shouldMigrate(serviceDiscoveryInvoker, invoker))) { @@ -229,6 +248,9 @@ public class MigrationInvoker implements MigrationClusterInvoker { protected synchronized void destroyServiceDiscoveryInvoker() { this.currentAvailableInvoker = invoker; if (serviceDiscoveryInvoker != null) { + if (logger.isDebugEnabled()) { + logger.debug("Destroying instance address invokers, will not listen for address changes until re-subscribed, " + type.getName()); + } serviceDiscoveryInvoker.destroy(); serviceDiscoveryInvoker = null; } @@ -237,12 +259,18 @@ public class MigrationInvoker implements MigrationClusterInvoker { protected synchronized void discardServiceDiscoveryInvokerAddress() { this.currentAvailableInvoker = invoker; if (serviceDiscoveryInvoker != null) { + if (logger.isDebugEnabled()) { + logger.debug("Discarding instance addresses, total size " + serviceDiscoveryInvoker.getDirectory().getAllInvokers().size()); + } serviceDiscoveryInvoker.getDirectory().discordAddresses(); } } protected synchronized void refreshServiceDiscoveryInvoker() { if (needRefresh(serviceDiscoveryInvoker)) { + if (logger.isDebugEnabled()) { + logger.debug("Re-subscribing instance addresses, current interface " + type.getName()); + } serviceDiscoveryInvoker = registryProtocol.getServiceDiscoveryInvoker(cluster, registry, type, url); } } @@ -250,6 +278,9 @@ public class MigrationInvoker implements MigrationClusterInvoker { protected synchronized void refreshInterfaceInvoker() { if (needRefresh(invoker)) { // FIXME invoker.destroy(); + if (logger.isDebugEnabled()) { + logger.debug("Re-subscribing interface addresses for interface " + type.getName()); + } invoker = registryProtocol.getInvoker(cluster, registry, type, url); } } @@ -257,6 +288,9 @@ public class MigrationInvoker implements MigrationClusterInvoker { protected synchronized void destroyInterfaceInvoker() { this.currentAvailableInvoker = serviceDiscoveryInvoker; if (invoker != null) { + if (logger.isDebugEnabled()) { + logger.debug("Destroying interface address invokers, will not listen for address changes until re-subscribed, " + type.getName()); + } invoker.destroy(); invoker = null; } @@ -265,6 +299,9 @@ public class MigrationInvoker implements MigrationClusterInvoker { protected synchronized void discardInterfaceInvokerAddress() { this.currentAvailableInvoker = serviceDiscoveryInvoker; if (invoker != null) { + if (logger.isDebugEnabled()) { + logger.debug("Discarding interface addresses, total address size " + invoker.getDirectory().getAllInvokers().size()); + } invoker.getDirectory().discordAddresses(); } } diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java index a300025861..2c3a90499f 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/MigrationRuleListener.java @@ -16,6 +16,7 @@ */ package org.apache.dubbo.registry.client.migration; +import org.apache.dubbo.common.URL; import org.apache.dubbo.common.config.configcenter.ConfigChangedEvent; import org.apache.dubbo.common.config.configcenter.ConfigurationListener; import org.apache.dubbo.common.config.configcenter.DynamicConfiguration; @@ -49,6 +50,7 @@ public class MigrationRuleListener implements RegistryProtocolListener, Configur public MigrationRuleListener() { this.configuration = ApplicationModel.getEnvironment().getDynamicConfiguration().orElseGet(null); + logger.info("Listening for migration rules on dataId-" + RULE_KEY + " group-" + DUBBO_SERVICEDISCOVERY_MIGRATION); configuration.addListener(RULE_KEY, DUBBO_SERVICEDISCOVERY_MIGRATION, this); String rawRule = configuration.getConfig(RULE_KEY, DUBBO_SERVICEDISCOVERY_MIGRATION); @@ -66,6 +68,9 @@ public class MigrationRuleListener implements RegistryProtocolListener, Configur return; } + logger.info("Using the following migration rule to migrate:"); + logger.info(rawRule); + if (CollectionUtils.isNotEmpty(listeners)) { listeners.forEach(listener -> listener.doMigrate(rawRule)); } @@ -77,7 +82,7 @@ public class MigrationRuleListener implements RegistryProtocolListener, Configur } @Override - public synchronized void onRefer(RegistryProtocol registryProtocol, ClusterInvoker invoker) { + public synchronized void onRefer(RegistryProtocol registryProtocol, ClusterInvoker invoker, URL url) { MigrationInvoker migrationInvoker = (MigrationInvoker) invoker; MigrationRuleHandler migrationListener = new MigrationRuleHandler<>(migrationInvoker); diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/ServiceDiscoveryMigrationInvoker.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/ServiceDiscoveryMigrationInvoker.java index e9aebe3fb0..ab08c868f9 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/ServiceDiscoveryMigrationInvoker.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/migration/ServiceDiscoveryMigrationInvoker.java @@ -27,8 +27,8 @@ import org.apache.dubbo.rpc.cluster.ClusterInvoker; public class ServiceDiscoveryMigrationInvoker extends MigrationInvoker { - public ServiceDiscoveryMigrationInvoker(RegistryProtocol registryProtocol, Cluster cluster, Registry registry, Class type, URL url) { - super(registryProtocol, cluster, registry, type, url); + public ServiceDiscoveryMigrationInvoker(RegistryProtocol registryProtocol, Cluster cluster, Registry registry, Class type, URL url, URL consumerUrl) { + super(registryProtocol, cluster, registry, type, url, consumerUrl); } @Override diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/InterfaceCompatibleRegistryProtocol.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/InterfaceCompatibleRegistryProtocol.java index d073aff06f..b7374a3cb8 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/InterfaceCompatibleRegistryProtocol.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/InterfaceCompatibleRegistryProtocol.java @@ -65,9 +65,9 @@ public class InterfaceCompatibleRegistryProtocol extends RegistryProtocol { return doCreateInvoker(directory, cluster, registry, type); } - protected ClusterInvoker getMigrationInvoker(RegistryProtocol registryProtocol, Cluster cluster, Registry registry, Class type, URL url) { + protected ClusterInvoker getMigrationInvoker(RegistryProtocol registryProtocol, Cluster cluster, Registry registry, Class type, URL url, URL consumerUrl) { // ClusterInvoker invoker = getInvoker(cluster, registry, type, url); - return new MigrationInvoker(registryProtocol, cluster, registry, type, url); + return new MigrationInvoker(registryProtocol, cluster, registry, type, url, consumerUrl); } } diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java index cf4a70800e..babcce2e1d 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java @@ -443,31 +443,32 @@ public class RegistryProtocol implements Protocol { String group = qs.get(GROUP_KEY); if (group != null && group.length() > 0) { if ((COMMA_SPLIT_PATTERN.split(group)).length > 1 || "*".equals(group)) { - return doRefer(Cluster.getCluster(MergeableCluster.NAME), registry, type, url); + return doRefer(Cluster.getCluster(MergeableCluster.NAME), registry, type, url, qs); } } Cluster cluster = Cluster.getCluster(qs.get(CLUSTER_KEY)); - return doRefer(cluster, registry, type, url); + return doRefer(cluster, registry, type, url, qs); } - protected Invoker doRefer(Cluster cluster, Registry registry, Class type, URL url) { - ClusterInvoker migrationInvoker = getMigrationInvoker(this, cluster, registry, type, url); - return interceptInvoker(migrationInvoker, url); + protected Invoker doRefer(Cluster cluster, Registry registry, Class type, URL url, Map parameters) { + URL consumerUrl = new URL(CONSUMER_PROTOCOL, parameters.remove(REGISTER_IP_KEY), 0, type.getName(), parameters); + ClusterInvoker migrationInvoker = getMigrationInvoker(this, cluster, registry, type, url, consumerUrl); + return interceptInvoker(migrationInvoker, url, consumerUrl); } - protected ClusterInvoker getMigrationInvoker(RegistryProtocol registryProtocol, Cluster cluster, Registry registry, Class type, URL url) { - return new ServiceDiscoveryMigrationInvoker(registryProtocol, cluster, registry, type, url); + protected ClusterInvoker getMigrationInvoker(RegistryProtocol registryProtocol, Cluster cluster, Registry registry, Class type, URL url, URL consumerUrl) { + return new ServiceDiscoveryMigrationInvoker(registryProtocol, cluster, registry, type, url, consumerUrl); } - protected Invoker interceptInvoker(ClusterInvoker invoker, URL url) { + protected Invoker interceptInvoker(ClusterInvoker invoker, URL url, URL consumerUrl) { List listeners = findRegistryProtocolListeners(url); if (CollectionUtils.isEmpty(listeners)) { return invoker; } for (RegistryProtocolListener listener : listeners) { - listener.onRefer(this, invoker); + listener.onRefer(this, invoker, consumerUrl); } return invoker; } diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocolListener.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocolListener.java index 41926b84bb..c4cade526c 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocolListener.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocolListener.java @@ -41,9 +41,10 @@ public interface RegistryProtocolListener { * * @param registryProtocol RegistryProtocol instance * @param invoker invoker + * @param url * @see RegistryProtocol#refer(Class, URL) */ - void onRefer(RegistryProtocol registryProtocol, ClusterInvoker invoker); + void onRefer(RegistryProtocol registryProtocol, ClusterInvoker invoker, URL url); /** * Notify RegistryProtocol's listeners when the protocol is destroyed