apache / dubbo-js

The Typescript implementation of Apache Dubbo. An RPC and microservice framework for Node.js and Web development.
https://dubbo.apache.org/
Apache License 2.0
767 stars 160 forks source link

配置“group”信息无效,可能是dubbo-url的from方法有问题 #137

Closed shige8023 closed 5 years ago

shige8023 commented 5 years ago

dubbosetting配置了“group”信息后调用失败,导致我一度以为是我配置写错了,深入探究了该项目源码后,发现dubbo-url的from方法这里,取的“group”是“group”,然后查了dubbo的服务注册信息,发现group信息的配置为“default.group”,将dubbo-url的from方法改为如下,可以正常使用 class DubboUrl { constructor(providerUrl) { log('DubboUrl from -> %s', providerUrl); this._url = url_1.default.parse(providerUrl); this._query = querystring_1.default.parse(providerUrl); this.host = this._url.hostname; this.port = Number(this._url.port); this.path = this._url.pathname.substring(1); this.dubboVersion = this._query.dubbo || ''; this.version = this._query.version || this._query['default.version'] || '0.0.0'; this.group = this._query.group || this._query['default.group']|| ''; } static from(providerUrl) { return new DubboUrl(providerUrl); } }

hufeng commented 5 years ago

fixed https://github.com/apache/dubbo-js/pull/138