A middleware helps node to communicate dubbo by using its default protocol, which is registered in zookeeper
300
stars
80
forks
source link
Dubbo service init done TypeError: Dubbo.FOO.sayHello is not a function #37
Closed
65725738 closed 7 years ago
什么情况?
const nzd=require('node-zookeeper-dubbo'); const app=require('express')(); const opt={ application:{name:'hello-world-app'}, register:'localhost:2181', root:'dubbo', dependencies:{ FOO:{interface:'com.mor.server.dubbo.service.DemoServer',version:'LATEST',timeout:6000} } } const Dubbo=new nzd(opt); var arg1={$class:'java.lang.String',$:'13100000001'}//参数1 var args=[arg1];//参数数组 app.get('/foo',function(req,res){ Dubbo.FOO.sayHello(args) .then(function(data){ res.send(data); }).catch(function(err){ res.send(err); }); })
app.listen(9090)