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 2021/11/04 06:26:10 UTC

[GitHub] [dubbo-go] firstpersonl opened a new issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

firstpersonl opened a new issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558


   mycode
   ```
   import (
   	"context"
   	"dubbo.apache.org/dubbo-go/v3/common/logger"
   	"dubbo.apache.org/dubbo-go/v3/config"
   	_ "dubbo.apache.org/dubbo-go/v3/imports"
   	"dubbo_go_demo/api"
   )
   
   func main() {
   	config.SetProviderService(&GreeterProvider{})
   	applicationConfig := config.NewApplicationConfigBuilder().SetModule("provider-1").SetMetadataType("remote").Build()
   	metadataReportConfig := config.NewMetadataReportConfigBuilder().
   		SetProtocol("nacos").
   		SetMetadataType("remote").
   		SetAddress("127.0.0.1:8848").SetTimeout("3s").SetGroup("public").SetUsername("nacos").SetPassword("nacos").Build()
   	rc := config.NewRootConfigBuilder().
   		SetProvider(config.NewProviderConfigBuilder().
   			AddService("GreeterProvider", config.NewServiceConfigBuilder().
   				SetInterface("org.apache.dubbo.UserProvider").
   				SetProtocolIDs("tripleProtocolKey").
   				Build()).
   			SetRegistryIDs("registryKey").
   			Build()).
   		AddProtocol("tripleProtocolKey", config.NewProtocolConfigBuilder().
   			SetName("tri").
   			Build()).
   		AddRegistry("registryKey",
   			config.NewRegistryConfigBuilder().
   				SetProtocol("nacos").
   				SetAddress("127.0.0.1:8848").
   				SetTimeout("3s").
   				SetGroup("public").
   				SetUsername("nacos").
   				SetPassword("nacos").
   				SetRegistryType("service").
   			Build()).
   		SetApplication(applicationConfig).
   		SetMetadataReport(metadataReportConfig).
   		Build()
   
   	if err := rc.Init(); err != nil {
   		panic(err)
   	}
   
   	select {}
   }
   ```
   问题分析:
   registry/nacos.newNacosServiceDiscovery使用了config.Load()所填充的私有属性的配置
   


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] AlexStocks commented on issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558#issuecomment-962416981


   > 框架配置后,未将全局配置指针更新。我快速修
   
   注意全局变量用 lock 保护下


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] LaurenceLiZhixin commented on issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558#issuecomment-961924937






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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] LaurenceLiZhixin commented on issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558#issuecomment-962414337


   是一个bug,通过 API 方式写入框架配置后,未将全局配置指针更新。我快速修复一下。


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] LaurenceLiZhixin closed issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin closed issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558


   


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] LaurenceLiZhixin commented on issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558#issuecomment-961924937


   我看下这个问题


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] LaurenceLiZhixin edited a comment on issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin edited a comment on issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558#issuecomment-962416187


   > 不通配置方式启动服务的API也不一样,是否如考虑统一启动入口
   这一点提醒了我。我有一个思路是:
   1. 通过api build rootConfig 
   2. config.Load(config.WithRootConfig(rootConfig)) 启动,您觉得怎么样?
   对于文件读取配置的,依然是config.Load(),WithRootConfig 作为一个可选项。
   @firstpersonl


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] LaurenceLiZhixin commented on issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558#issuecomment-962416187


   > 不通配置方式启动服务的API也不一样,是否如考虑统一启动入口
   这一点提醒了我。我有一个思路是:
   1. 通过api build rootConfig 
   2. config.Load(config.WithRootConfig(rootConfig)) 启动,您觉得怎么样?
   对于文件读取配置的,依然是config.Load(),WithRootConfig 作为一个可选项。
   


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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


[GitHub] [dubbo-go] firstpersonl commented on issue #1558: 应用级服务发现使用ConfigBuilder方式启动。newNacosServiceDiscovery获取的MetadataReport为nil

Posted by GitBox <gi...@apache.org>.
firstpersonl commented on issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558#issuecomment-962414883


   不通配置方式启动服务的API也不一样,是否如考虑统一启动入口


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

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

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