Skip to content

Commit

Permalink
fix metadata, serialization and metadata url
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj committed Aug 1, 2024
1 parent 9dc558b commit cde8a93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions metadata/service/exporter/configurable/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (exporter *MetadataServiceExporter) exportV1() error {
invoker := server.NewInternalInvoker(ivkURL, &info, exporter.metadataServiceV1)
exporter.Exporter = extension.GetProtocol(protocolwrapper.FILTER).Export(invoker)
logger.Infof("[Metadata Service] MetadataService has been exported at url : %v ", invoker.GetURL())
exporter.metadataService.SetMetadataServiceURL(ivkURL)
exporter.metadataService.SetMetadataServiceURL(invoker.GetURL())
return nil
}
}
Expand Down Expand Up @@ -160,18 +160,23 @@ func getMetadataProtocolAndPort() (string, string) {
}

var protocolConfig *config.ProtocolConfig
for s, pc := range rootConfig.Protocols {
if s != constant.DefaultProtocol && s != constant.TriProtocol {
for _, pc := range rootConfig.Protocols {
if pc.Name != constant.DefaultProtocol && pc.Name != constant.TriProtocol {
continue
}
if s == protocol {
if pc.Name == protocol {
protocolConfig = pc
break
}
}

if protocol == "" {
protocolConfig = rootConfig.Protocols[constant.TriProtocol]
for _, pc := range rootConfig.Protocols {
if pc.Name == constant.TriProtocol {
protocolConfig = pc
break
}
}
}

if protocolConfig == nil {
Expand Down
1 change: 1 addition & 0 deletions metadata/service/local/metadata_service_proxy_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func buildStandardMetadataServiceURL(ins registry.ServiceInstance) []*common.URL
u.Path = constant.MetadataServiceV2Name
u.SetParam(constant.VersionKey, metaV)
u.SetParam(constant.InterfaceKey, constant.MetadataServiceV2Name)
u.DelParam(constant.SerializationKey)
} else {
u.SetParam(constant.SerializationKey, constant.Hessian2Serialization)
}
Expand Down

0 comments on commit cde8a93

Please sign in to comment.