We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题,通过下面的配置方式初始化dubbo-go,最大消息长度仍然是默认的4M
func InitDubbo(moduleName, environmentName, groupName, nacosUrl, nameSpace string, nacosPort int) { dataId := fmt.Sprintf("%s-%s", moduleName, environmentName) nacosAddress := fmt.Sprintf("%s:%d", nacosUrl, nacosPort) initProvider() // 单独给这个服务设置grpc最大值 fileServiceConfig := config.NewServiceConfigBuilder().Build() fileServiceConfig.GrpcMaxMessageSize = 100 rootConfig := config.NewRootConfigBuilder(). SetProvider(config.NewProviderConfigBuilder(). AddService("FileProvider", fileServiceConfig).Build()). SetConfigCenter(config.NewConfigCenterConfigBuilder(). SetProtocol("nacos").SetAddress(nacosAddress).SetNamespace(nameSpace). SetDataID(dataId).SetGroup(groupName).Build()). Build() if err := config.Load(config.WithRootConfig(rootConfig)); err != nil { panic("Init Dubbo Error Please Check Config") } }
打断点调试后发现在 /protocol/dubbo3/dubbo3_protocol.go 的 openServer 方法中虽然有下列配置最大消息的代码,但是只有第一个 Provider 的配置才会走这段代码,而注册的第一个服务是 ServerReflection ,此服务是默认配置,而不是我上述代码的配置。
/protocol/dubbo3/dubbo3_protocol.go
openServer
ServerReflection
// openServer open a dubbo3 server, if there is already a service using the same protocol, it returns directly. func (dp *DubboProtocol) openServer(url *common.URL, tripleCodecType tripleConstant.CodecType) { dp.serverLock.Lock() defer dp.serverLock.Unlock() _, ok := dp.serverMap[url.Location] // 此处的判断导致带有 GrpcMaxMessageSize 配置内容的 Provider 被return,无法改变 Triple 的配置 if ok { dp.serverMap[url.Location].RefreshService() return } // ... 省略代码 if maxCall := url.GetParam(constant.MaxServerRecvMsgSize, ""); maxCall != "" { if size, err := strconv.Atoi(maxCall); err == nil && size != 0 { opts = append(opts, triConfig.WithGRPCMaxServerRecvMessageSize(size)) } } if maxCall := url.GetParam(constant.MaxServerSendMsgSize, ""); maxCall != "" { if size, err := strconv.Atoi(maxCall); err == nil && size != 0 { opts = append(opts, triConfig.WithGRPCMaxServerSendMessageSize(size)) } } // ... 省略代码 }
断点调试信息
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Issue description
如题,通过下面的配置方式初始化dubbo-go,最大消息长度仍然是默认的4M
打断点调试后发现在
/protocol/dubbo3/dubbo3_protocol.go
的openServer
方法中虽然有下列配置最大消息的代码,但是只有第一个 Provider 的配置才会走这段代码,而注册的第一个服务是ServerReflection
,此服务是默认配置,而不是我上述代码的配置。Logs
断点调试信息
The text was updated successfully, but these errors were encountered: