diff --git a/server/rpc_server.go b/server/rpc_server.go index c6576a71..516825db 100644 --- a/server/rpc_server.go +++ b/server/rpc_server.go @@ -453,9 +453,14 @@ func (s *rpcServer) Deregister() error { return err } + // mq-rpc(eg. nats) doesn't need the port. its addr is queue name. + if port != "" { + addr = mnet.HostPort(addr, port) + } + node := ®istry.Node{ Id: config.Name + "-" + config.Id, - Address: mnet.HostPort(addr, port), + Address: addr, } service := ®istry.Service{