Skip to content

Commit

Permalink
[Feature] To add the default metadata into ServiceInstance (#5330)
Browse files Browse the repository at this point in the history
* Polish #5306 : [Migration] Upgrade the @SInCE tags in Javadoc migration cloud native to master

* Polish #5306 : [Migration] Upgrade the @SInCE tags in Javadoc migration cloud native to master

* Polish #5309 : [ISSURE] The beans of Dubbo's Config can't be found on the ReferenceBean's initialization

* Polish #5312 : Resolve the demos' issues of zookeeper and nacos

* Polish #5313 : [Migration] migrate the code in common module from cloud-native branch to master

* Polish #5316 : [Refactor] Replace @EnableDubboConfigBinding Using spring-context-support

* Polish #5317 : [Refactor] Refactor ReferenceAnnotationBeanPostProcessor using Alibaba spring-context-suuport API

* Polish #5321 : Remove BeanFactoryUtils

* Polish #5321 : Remove AnnotatedBeanDefinitionRegistryUtils

* Polish #5321 : Remove AnnotationUtils

* Polish #5321 : Remove ClassUtils

* Polish #5321 : Remove BeanRegistrar

* Polish #5321 : Remove ObjectUtils

* Polish #5321 : Remove PropertySourcesUtils

* Polish #5325 : [Migration] To migrate dubbo-metadata-api from cloud-native branch

* Polish #5326 : [Migration] To migrate dubbo-metadata-processor from cloud-native branch

* Polish #5329 : [Feature] To add the default metadata into ServiceInstance
  • Loading branch information
mercyblitz authored Nov 14, 2019
1 parent 1722689 commit d4ba7f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@
* @since 2.7.5
*/
@SPI(DEFAULT_METADATA_STORAGE_TYPE)

public interface MetadataServiceProxyFactory {

/**
* Create a {@link MetadataService} proxy via the specified {@link ServiceInstance}
*WritableMetadataService
*
* @param serviceInstance the instance of {@link ServiceInstance}
* @return non-null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
import org.apache.dubbo.metadata.report.identifier.MetadataIdentifier;
import org.apache.dubbo.metadata.report.identifier.ServiceMetadataIdentifier;
import org.apache.dubbo.registry.client.ServiceInstance;
import org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils;

import java.util.Collection;
import java.util.Collections;
import java.util.SortedSet;
import java.util.TreeSet;

import static org.apache.dubbo.common.constants.CommonConstants.PROVIDER_SIDE;
import static org.apache.dubbo.registry.client.metadata.ServiceInstanceMetadataUtils.EXPORTED_SERVICES_REVISION_PROPERTY_NAME;
import static org.apache.dubbo.registry.client.metadata.URLRevisionResolver.NO_REVISION;

/**
* 2019-08-09
Expand All @@ -31,8 +32,7 @@ public class RemoteMetadataServiceProxy implements MetadataService {
public RemoteMetadataServiceProxy(ServiceInstance serviceInstance) {
this.serviceName = serviceInstance.getServiceName();
// this is ServiceInstance of registry(Provider)
this.revision = serviceInstance.getMetadata()
.getOrDefault(ServiceInstanceMetadataUtils.EXPORTED_SERVICES_REVISION_PROPERTY_NAME, "");
this.revision = serviceInstance.getMetadata().getOrDefault(EXPORTED_SERVICES_REVISION_PROPERTY_NAME, NO_REVISION);
}

@Override
Expand Down

0 comments on commit d4ba7f9

Please sign in to comment.