diff --git a/config/config_loader.go b/config/config_loader.go index 99c35b22f1..9fbe8f91aa 100644 --- a/config/config_loader.go +++ b/config/config_loader.go @@ -77,7 +77,7 @@ func registerServiceInstance() { if err != nil { panic(err) } - p := extension.GetProtocol(constant.RegistryKey) + p := extension.GetProtocol(constant.RegistryProtocol) var rp registry.RegistryFactory var ok bool if rp, ok = p.(registry.RegistryFactory); !ok { diff --git a/config/graceful_shutdown.go b/config/graceful_shutdown.go index 54ed81b601..de3254183f 100644 --- a/config/graceful_shutdown.go +++ b/config/graceful_shutdown.go @@ -119,7 +119,7 @@ func BeforeShutdown() { func destroyAllRegistries() { logger.Info("Graceful shutdown --- Destroy all registriesConfig. ") - registryProtocol := extension.GetProtocol(constant.RegistryKey) + registryProtocol := extension.GetProtocol(constant.RegistryProtocol) registryProtocol.Destroy() } diff --git a/config/service_config.go b/config/service_config.go index fe8ba4b97a..d669c8c5c3 100644 --- a/config/service_config.go +++ b/config/service_config.go @@ -294,7 +294,7 @@ func (s *ServiceConfig) Export() error { s.cacheMutex.Lock() if s.cacheProtocol == nil { logger.Debugf(fmt.Sprintf("First load the registry protocol, url is {%v}!", ivkURL)) - s.cacheProtocol = extension.GetProtocol("registry") + s.cacheProtocol = extension.GetProtocol(constant.RegistryProtocol) } s.cacheMutex.Unlock() diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go index 1b0d390d09..a869ab716f 100644 --- a/registry/protocol/protocol.go +++ b/registry/protocol/protocol.go @@ -70,7 +70,7 @@ type registryProtocol struct { } func init() { - extension.SetProtocol("registry", GetProtocol) + extension.SetProtocol(constant.RegistryProtocol, GetProtocol) } func newRegistryProtocol() *registryProtocol {