nodejs connect dubbo by default protocol in zookeeper
dubbo service version
zookeeper conn url
the service you need
dubbo version
var Service=require('node-zookeeper-dubbo');
var opt={
env:'test', // dubbo service version
gruop:'dubbo', // dubbo group default by 'dubbo',optional
conn:'127.0.0.1:2180', // zookeeper url
path:'com.customer.Service', // service url
version:'2.3.4.5' // dubbo version
}
var method="getUserByID";
var arg1={$class:'int',$:123}
var args=[arg1];
var service = new Service(opt);
service.excute(method,args,function(err,data){
if(err){
console.log(err);
return;
}
console.log(data)
})
or
service
.excute(method,args)
.then(function(data){
console.log(data);
})
.catch(function(err) {
console.log(err);
})
you can use js-to-java
var arg1={$class:'int',$:123};
//equivalent
var arg1=java('int',123);
Default the zookeeper connection is keep-alive,you can call service.zoo.close()
to close the connect;
want to join us? if u have any interests,contact me or send your CV to [email protected]