Added zrpc server custom serverID for custom registration Key when the service is registered on ETCD. (#3008)
This commit is contained in:
@@ -26,6 +26,9 @@ func NewRpcPubServer(etcd discov.EtcdConf, listenOn string, middlewares ServerMi
|
||||
pubOpts = append(pubOpts, discov.WithPubEtcdTLS(etcd.CertFile, etcd.CertKeyFile,
|
||||
etcd.CACertFile, etcd.InsecureSkipVerify))
|
||||
}
|
||||
if etcd.HasServerID() {
|
||||
pubOpts = append(pubOpts, discov.WithId(etcd.ServerID))
|
||||
}
|
||||
pubClient := discov.NewPublisher(etcd.Hosts, etcd.Key, pubListenOn, pubOpts...)
|
||||
return pubClient.KeepAlive()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user