You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/12/27 09:02:41 UTC

[GitHub] [dubbo-go] fangyincheng commented on a change in pull request #948: Fix: make metadata report work without serviceDiscovery

fangyincheng commented on a change in pull request #948:
URL: https://github.com/apache/dubbo-go/pull/948#discussion_r549085991



##########
File path: common/extension/metadata_service.go
##########
@@ -48,3 +51,17 @@ func GetMetadataService(msType string) (service.MetadataService, error) {
 		"local - github.com/apache/dubbo-go/metadata/service/inmemory, \n"+
 		"remote - github.com/apache/dubbo-go/metadata/service/remote", msType))
 }
+
+// GetRemoteMetadataService will get a RemoteMetadataService instance
+func GetRemoteMetadataService() (service.MetadataService, error) {
+	if remoteMetadataService != nil {
+		return remoteMetadataService, nil
+	}
+	if creator, ok := metadataServiceInsMap["remote"]; ok {
+		var err error
+		remoteMetadataService, err = creator()
+		return remoteMetadataService, err
+	}
+	logger.Info("could not find the metadata service creator for metadataType: remote")

Review comment:
       it should be `warm`?

##########
File path: metadata/service/remote/service.go
##########
@@ -114,22 +114,42 @@ func (mts *MetadataService) UnsubscribeURL(url *common.URL) error {
 func (mts *MetadataService) PublishServiceDefinition(url *common.URL) error {
 	interfaceName := url.GetParam(constant.INTERFACE_KEY, "")
 	isGeneric := url.GetParamBool(constant.GENERIC_KEY, false)
-	if len(interfaceName) > 0 && !isGeneric {
-		sv := common.ServiceMap.GetServiceByServiceKey(url.Protocol, url.ServiceKey())
-		sd := definition.BuildServiceDefinition(*sv, url)
+	if common.RoleType(common.PROVIDER).Role() == url.GetParam(constant.SIDE_KEY, "") {
+		if len(interfaceName) > 0 && !isGeneric {
+			sv := common.ServiceMap.GetServiceByServiceKey(url.Protocol, url.ServiceKey())
+			sd := definition.BuildServiceDefinition(*sv, url)
+			id := &identifier.MetadataIdentifier{
+				BaseMetadataIdentifier: identifier.BaseMetadataIdentifier{
+					ServiceInterface: interfaceName,
+					Version:          url.GetParam(constant.VERSION_KEY, ""),
+					// Group:            url.GetParam(constant.GROUP_KEY, constant.SERVICE_DISCOVERY_DEFAULT_GROUP),

Review comment:
       if not use, pls remove it




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org