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/10/19 01:01:18 UTC

[GitHub] [dubbo-go] sanxun0325 commented on a change in pull request #784: Fix: issue 774 [fix metadata default port]

sanxun0325 commented on a change in pull request #784:
URL: https://github.com/apache/dubbo-go/pull/784#discussion_r507303096



##########
File path: metadata/service/exporter/configurable/exporter.go
##########
@@ -46,12 +46,21 @@ func NewMetadataServiceExporter(metadataService service.MetadataService) exporte
 }
 
 // Export will export the metadataService
-func (exporter *MetadataServiceExporter) Export() error {
+func (exporter *MetadataServiceExporter) Export(url *common.URL) error {
 	if !exporter.IsExported() {
 		serviceConfig := config.NewServiceConfig(constant.SIMPLE_METADATA_SERVICE_NAME, context.Background())
 		serviceConfig.Protocol = constant.DEFAULT_PROTOCOL
-		serviceConfig.Protocols = map[string]*config.ProtocolConfig{
-			constant.DEFAULT_PROTOCOL: generateMetadataProtocol(),
+		if url != nil && url.SubURL != nil {
+			serviceConfig.Protocols = map[string]*config.ProtocolConfig{
+				constant.DEFAULT_PROTOCOL: {
+					Name: url.SubURL.Protocol,
+					Port: url.SubURL.Port,
+				},
+			}
+		} else {

Review comment:
       When the URL is nil, it returns an error?




----------------------------------------------------------------
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