Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

the node module of dubbo client

NotificationsYou must be signed in to change notification settings

QianmiOpen/dubbo-node-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js.

NPM

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp