diff --git a/config/service_config.go b/config/service_config.go index 769ce5e6b5..adc03e3b68 100644 --- a/config/service_config.go +++ b/config/service_config.go @@ -348,8 +348,12 @@ func (svc *ServiceConfig) getUrlMap() url.Values { urlMap.Set(constant.LoadbalanceKey, svc.Loadbalance) urlMap.Set(constant.WarmupKey, svc.Warmup) urlMap.Set(constant.RetriesKey, svc.Retries) - urlMap.Set(constant.GroupKey, svc.Group) - urlMap.Set(constant.VersionKey, svc.Version) + if svc.Group != "" { + urlMap.Set(constant.GroupKey, svc.Group) + } + if svc.Version != "" { + urlMap.Set(constant.VersionKey, svc.Version) + } urlMap.Set(constant.RegistryRoleKey, strconv.Itoa(common.PROVIDER)) urlMap.Set(constant.ReleaseKey, "dubbo-golang-"+constant.Version) urlMap.Set(constant.SideKey, (common.RoleType(common.PROVIDER)).Role())