omnip620 / node-zookeeper-dubbo

A middleware helps node to communicate dubbo by using its default protocol, which is registered in zookeeper
300 stars 80 forks source link

(node:11892) Warning: Possible EventEmitter memory leak detected. 11 notification listeners added. Use emitter.setMaxListeners() to increase limit #40

Open chinaWangXianRong opened 7 years ago

chinaWangXianRong commented 7 years ago

开发的时候时不时地报这个警告,这个警告是Events模块中的,根据提示,是监测notification 这个的,但是我没有监测,搜索整个项目是nodezookeeperdubbo中有

而默认是10个监听器,我问下怎么设置监听器啊 如果我的想的有问题,望指正

chinaWangXianRong commented 7 years ago

` } if (this.childWatchers[watcherEvent.path]) { emitters.push(this.childWatchers[watcherEvent.path]); delete this.childWatchers[watcherEvent.path]; } break; default: throw new Error('Unknown event type: ' + watcherEvent.type); }

if (emitters.length < 1) {
    return;
}

event = Event.create(watcherEvent);

emitters.forEach(function (emitter) {
    emitter.emit('notification', event);
});

};`

chinaWangXianRong commented 7 years ago

在文件WatcherManager.js中

omnip620 commented 7 years ago

这个是依赖库里面的代码 一般情况下 只要dubbo和nzd的配置没问题的话 是不会报错的 建议检查下各项配置参数

chinaWangXianRong commented 7 years ago
{
            application:{name:'rd-web'},//应用信息,用于计算依赖关系
            dubboVer:'2.5.3',//dubbo版本
            root:'dubbo',//注册到zk上的根节点,默认为dubbo
            register:'192.168.8.111:2181',//zookeeper地址
            dependencies:{//接口依赖
                HomeService:{interface:'com.mmia.rd.common.service.HomeService',timeout:1000},
                SolrService:{interface:'com.mmia.rd.common.service.SolrService',timeout:1000}
            }

对吗 还是报那个