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

增加withType参数 #53

Open lishengguo opened 7 years ago

lishengguo commented 7 years ago

增加withType参数,控制hessian是否返回{$class:'',$:{}},

omnip620 commented 7 years ago

感谢提供新特性,不过有点不太明白这个参数的意义,能否稍微详细说明下,以及参数有哪些可选值,🙏。

lishengguo commented 7 years ago

withType是hessian返回的对像是否带类型,默认为false,为true时返回值形式如:{$class:'java.lang.Long',$:100}。 opt.withType改成opt.returnWithType更好理解点, 是吧。

xiaojinhe2 commented 5 years ago

Hello, I would like to ask node-zookeeper-dubbo this module how to use it, I always use TypeError: Cannot read property 'buildUserAgentTree' of undefined can not find the method, in fact, this service interface exists, I use telnet to log in dubbo When you can view the interface information of the service through ls, the following is my call code, trouble to help look down

var nzd = require('node-zookeeper-dubbo');

const opt = { application:{ name:'parkhelper-service' }, registry:'127.0.0.1:2182', dubboVer:'2.6.1', group:'cn.parkhelper', root:'dubbo', dependencies:{ AgentService:{ interface:'cn.parkhelper.service.park.AgentService', version:'1.0-SNAPSHOT', group:'cn.parkhelper', timeout:5000 } } };

const Dubbo = new nzd(opt);

var arg1 = {$class:'java.lang.String',$:'8a04a41f59305d810159639b42ae000d'}; Dubbo.AgentService.buildUserAgentTree(arg1).then(function(data){ //error message is here console.log(data); }).catch(function(err){ console.log(err); })