You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2019/10/18 16:38:14 UTC
[GitHub] [dubbo-js] hufeng commented on issue #132: Add zookeeper auth
supports
hufeng commented on issue #132: Add zookeeper auth supports
URL: https://github.com/apache/dubbo-js/pull/132#issuecomment-543827572
@xusd320
感谢你的pr ^_^
因为后续我们会支持多注册中心,支持开发者很方便的自定义自己的注册中心,所有我前段时间做了注册中心的代码重构,目前的api
```js
const dubbo = new Dubbo<typeof service>({
application: {name: 'node-dubbo'},
// 这个作为一个兼容模式存在默认为zk作为注册中心,未来我们可能支持redis,naccos
register: 'localhost:2181',
service,
});
```
所以通过这样设计就比较单薄了不方便扩展,而且会让dubbo的初始化参数爆表。
所以做了重构之后,我们希望是这样的设计:
```js
import {Dubbo, setting, Zk} from 'dubbo2.js';
const dubbo = new Dubbo<typeof service>({
application: {name: 'dubbo-node-consumer'},
service,
dubboSetting,
register: Zk({
url: 'localhost:2181,localhost:2182,localhost:2183',
// others arguments, for example authInfo
}),
});
```
这样注册中心的扩展性就不会影响到Dubbo的入口参数,Keep it simple.
所以希望authInfo不要挂在this.props.authInfo, 而是作为Zk的入口参数。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org