diff --git a/cluster/node/node.go b/cluster/node/node.go index 581fd67..f6423f2 100644 --- a/cluster/node/node.go +++ b/cluster/node/node.go @@ -85,6 +85,10 @@ func (n *Node) Start() { return } + if n.opts.transporter != nil { + n.opts.transporter.SetDefaultDiscovery(n.opts.registry) + } + n.startLinkServer() n.registerServiceInstance() diff --git a/transport/transporter.go b/transport/transporter.go index 35d5ddb..b4c68a1 100644 --- a/transport/transporter.go +++ b/transport/transporter.go @@ -38,3 +38,5 @@ type Transporter interface { // SetDefaultDiscovery 设置默认的服务发现组件 SetDefaultDiscovery(discovery registry.Discovery) } + +type NewMeshClient func(target string) (Client, error)