- Notifications
You must be signed in to change notification settings - Fork28
QianmiOpen/dubbo-node-client
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
npm install dubbo-node-client
该项目只支持jsonrpc协议, 不支持 dubbo协议的服务提供者
publicinterfacePhoneNoCheckProvider {booleanisPhoneNoLimit(Operatorsoperators,Stringno,Stringuserid);booleanisPhone(Stringno);}
//vardubboClient=require('dubbo-node-client');//加载配置文件dubboClient.config(require('./dubbo.config.js'));//获取serivcevarphoneNoCheckService=dubboClient.getService('com.ofpay.ofdc.api.phone.PhoneNoCheckProvider',version,group);//调用方式一, 这种可以立即调用, 无需延迟phoneNoCheckService.call('isPhone',"13999999999").then(function(result){//成功returnthis.call('isPhoneNoLimit',"MOBILE","130000","A001");}).catch(function(error){//失败}).finally(function(){//不管成功还是失败});//调用方式二, 这种需要延迟, 因为provider的方法是由zookeeper的节点提供,//所以要先查到这个provider的节点, 这个步骤是异步的, 就导致你如果直接调用方法会报错phoneNoCheckService.isPhone('xxxxx');//当然如果你是在Express里面调用, 那肯定没有问题.functiondoFoo(req,res){phoneNoCheckService.isPhone('xxxxx').then(function(out){res.send(out);});}
About
the node module of dubbo client
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
