Dubbo服务命令

Dubbo服务命令

命令列表

  • 进入shell终端连接服务命令:
telnet ip 端口号 ,按回车键进入dubbo命令模式。
  • 查看服务列表命令:
 ls 
ls
  • 查看服务详细列表:
ls -l
  • 查看某个服务的方法列表:
ls ***Service
  • 查看服务的方法的详细列表:
ls -l ***Service
  1. 调用服务的接口命令:
invoke com.test.TestService.selectBuyId('name')
  • 调用服务的方法:
invoke ***Service.***Method('name')
  • 查看状态列表:
status -l
  • 退出当前telnet命令行:
exit

代码演示

命令行调用dubbo远程服务

telnet远程连接到dubbo

[admin@dev666 ~]$ telnet 172.20.20.85 20888
Trying 172.20.20.85...
Connected to 172.20.20.85 (172.20.20.85).
Escape character is '^]'.

查看提供服务的接口

dubbo>ls com.vj.facade.DayDayRiskCheckFacade
No such service com.vj.facade.DayDayRiskCheckFacade
dubbo>ls
com.vj.facade.DayDayRiskCheckFacadeTransFacade
com.vj.facade.DayDayRiskCheckFacadePolicyQueryFacade
com.vj.facade.DayDayRiskCheckFacadeCheckFacade
com.vj.facade.DayDayRiskCheckFacadeFacade
dubbo>Connection closed by foreign host.
dubbo>ls
com.vj.service.TestInfoQueryService

ls 接口名对外提供的方法


dubbo>ls com.vj.service.TestInfoQueryService
queryByInfoCode
queryInfo

invoke调用服务

invoke 接口名.方法名(参数) 进行调用

dubbo>invoke com.vj.service.TestInfoQueryService.queryByInfoCode("00000A0")
{"result":{"infoCode":"info0","stat":"001","ip":"192.168.1.0","infoOwncode":"自编号0","phone":"13600000","infoAreaCode":"12345","address":"地址0","date":"2017-01-22 00:00:00","addressType":"0001","name":"名称0","id":14001,"contacts":"联系人0","infoCode":"00000A0"},"errorCode":"INFOCODE000000","errorMsg":"获取信息成功。"}
dubbo>invoke TestInfoQueryService.queryByInfoCode({"data":{"toCustomerId":"tcid-03-001","customerId":"cid-03-001","customerName":"cname1"},"checkPoint":"CP002"})

-end-

More from my site

好烂啊有点差凑合看看还不错很精彩 (1 votes, average: 5.00 out of 5)
Loading...
486 views

3 thoughts on “Dubbo服务命令

  1. Thanks , I’ve recently been searching for information about this subject for ages and yours is the best I have discovered so far. But, what about the conclusion? Are you sure about the source?

  2. Useful information. Fortunate me I discovered your website by accident, and I am shocked why this coincidence did not took place in advance! I bookmarked it.

发表评论

电子邮件地址不会被公开。 必填项已用*标注

跳至工具栏