文档章节

使用telnet进行Dubbo接口测试

o
 osc_y8yehimr
发布于 2019/03/20 09:53
字数 863
阅读 19
收藏 0

精选30+云产品,助力企业轻松上云!>>>

telnet进入dubbo

查看pid

$ jps -l
26048 org.apache.catalina.startup.Bootstrap
12388 org.jetbrains.jps.cmdline.Launcher
17492 com.shitou.Application
28452 sun.tools.jps.Jps
36196 com.jsy.OrderServerApplication

pid查询对应端口

$ netstat -ano |findstr 36196
  TCP    0.0.0.0:2112           0.0.0.0:0              LISTENING       36196
  TCP    0.0.0.0:20881          0.0.0.0:0              LISTENING       36196
  TCP    18.16.202.169:2138     18.16.200.42:3306      ESTABLISHED     36196
  TCP    18.16.202.169:2139     18.16.200.42:3306      ESTABLISHED     36196
  TCP    18.16.202.169:2140     18.16.200.42:3306      ESTABLISHED     36196
  TCP    18.16.202.169:2142     18.16.200.42:3306      ESTABLISHED     36196
  TCP    18.16.202.169:2143     18.16.200.42:3306      ESTABLISHED     36196
  TCP    18.16.202.169:2175     18.16.200.43:2181      ESTABLISHED     36196

telnet进入dubbo

telnet 127.0.0.1 20881

dubbo内命令查看

ls

  1. ls: 显示服务列表
  2. ls -l: 显示服务详细信息列表
  3. ls XxxService: 显示服务的方法列表
  4. ls -l XxxService: 显示服务的方法详细信息列表

查看该dubbo所有服务

dubbo>ls
com.jsy.order.api.OrderUfidaFacade
com.jsy.order.api.OrderPayAccountFacade
com.jsy.order.api.OrderTrialFacade
com.jsy.validation.ValidationFacade
com.jsy.order.api.OrderPayFacade
com.jsy.order.api.OrderFacade
com.jsy.order.api.OpenAccountHttpFacade
com.jsy.order.api.OpenAccountFacade
com.jsy.order.api.OrderFacade2
com.jsy.order.api.OrderRepaymentPlanFacade

查看dubbo所有服务详细信息

dubbo>ls -l
com.jsy.order.api.OrderUfidaFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OrderUfidaFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OrderUfidaFacade&methods=getOrderUfidaSplitAmount&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795641&version=1.0.0
com.jsy.order.api.OrderPayAccountFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OrderPayAccountFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OrderPayAccountFacade&methods=writeBankRepaymentPlan,orderPayment,getPayAccountStatus,getOrderBalance,orderPaymentAdvance,repaymentDetail&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795349&version=1.0.0
com.jsy.order.api.OrderTrialFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OrderTrialFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OrderTrialFacade&methods=checkTrial,orderSettleTrial,getOrderListByTrial&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795695&version=1.0.0
com.jsy.validation.ValidationFacade -> dubbo://169.254.173.208:20881/com.jsy.validation.ValidationFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.validation.ValidationFacade&methods=getAccessToken&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795477&version=1.0.0
com.jsy.order.api.OrderPayFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OrderPayFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OrderPayFacade&methods=updateOrderPayState,orderPay&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795535&version=1.0.0
com.jsy.order.api.OrderFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OrderFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OrderFacade&methods=createOrder,getOrderBorrowMoneyByOrderId,getOrderRepaymentPlanList,queryOrderAlreadyPayTotal,calcLoanAmount,OrderSettleMoneyTrial,queryOrderAlreadyPayTotalBatch,getOrderMoneyFlowingWater&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795279&version=1.0.0
com.jsy.order.api.OpenAccountHttpFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OpenAccountHttpFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OpenAccountHttpFacade&methods=OpenAccount,getCustomerWhiteList,getBankList,CustomerValidation&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795199&version=1.0.0
com.jsy.order.api.OpenAccountFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OpenAccountFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OpenAccountFacade&methods=OpenAccount,getCustomerWhiteList,getBankList,CustomerValidation&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795079&version=1.0.0
com.jsy.order.api.OrderFacade2 -> dubbo://169.254.173.208:20881/com.jsy.order.api.OrderFacade2?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OrderFacade2&methods=getOrderByOrderId&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795588&version=1.0.0
com.jsy.order.api.OrderRepaymentPlanFacade -> dubbo://169.254.173.208:20881/com.jsy.order.api.OrderRepaymentPlanFacade?anyhost=true&application=assets-order-server&dubbo=2.8.4&generic=false&group=DEV&interface=com.jsy.order.api.OrderRepaymentPlanFacade&methods=createPlans,viewPlan,getOrderPrepaymentPlanList&pid=36196&revision=1.0.0&side=provider&timestamp=1552984795414&version=1.0.0

查看某服务具体方法

dubbo>ls -l com.jsy.order.api.OrderRepaymentPlanFacade
com.jsy.apiutil.entity.BaseRes viewPlan(java.lang.String)
com.jsy.apiutil.entity.BaseRes createPlans(java.lang.String)
com.jsy.apiutil.entity.BaseRes getOrderPrepaymentPlanList(java.lang.String,java.lang.String,java.lang.String,java.lang.String)

ps:

  1. ps: 显示服务端口列表
  2. ps -l: 显示服务地址列表
  3. ps 20880: 显示端口上的连接信息
  4. ps -l 20880: 显示端口上的连接详细信息
dubbo>ps
20881

dubbo>ps -l
dubbo://18.16.200.95:20881

dubbo>ps 20881
/18.16.200.47:33608
/18.16.200.84:18394
/18.16.200.74:12150
/18.16.200.110:49710
/18.16.200.110:57710
/18.16.200.75:62839
/127.0.0.1:57041

dubbo>ps -l 20881
/18.16.200.47:33608 -> /18.16.200.95:20881
/18.16.200.84:18394 -> /18.16.200.95:20881
/18.16.200.74:12150 -> /18.16.200.95:20881
/18.16.200.110:49710 -> /18.16.200.95:20881
/18.16.200.110:57710 -> /18.16.200.95:20881
/18.16.200.75:62839 -> /18.16.200.95:20881
/127.0.0.1:57041 -> /127.0.0.1:20881

trace:

  1. trace XxxService: 跟踪 1 次服务任意方法的调用情况
  2. trace XxxService 10: 跟踪 10 次服务任意方法的调用情况
  3. trace XxxService xxxMethod: 跟踪 1 次服务方法的调用情况
  4. trace XxxService xxxMethod 10: 跟踪 10 次服务方法的调用情况
dubbo>trace com.jsy.order.api.OrderTrialFacade

/18.16.202.169:2732 -> com.jsy.order.api.OrderTrialFacade.getOrderListByTrial([["օ·¼","²㋔"]]) -> {"msg":"³ɹ¦","data":[{"colligateRate":0.15,"expireTime":"2019-03-21 17:45:24","issue":3,"loanNo":"JSY20190315000001","loanStatus":"6","paymentTypeDesc":"ЈϢº󱼢,"loanStatusDesc":"ʺ³ɻ¹¿»®","loanAmount":800000.0,"customerName":"օɽ","loansTime":"2019-03-21 17:45:24","paymentType":"10","overdueIssue":0},{"colligateRate":0.35,"expireTime":"2019-03-21 17:45:24","issue":12,"loanNo":"JSY20190315000002","loanStatus":"6","paymentTypeDesc":"¿쵻(Ϟ½»ӗ)","loanStatusDesc":"ʺ³ɻ¹¿»®","loanAmount":500000.0,"customerName":"n̄","loansTime":"2019-03-21 17:45:24","paymentType":"9","overdueIssue":8}],"status":"10000"}
elapsed: 0 ms.

invoke:

调用某方法

dubbo>invoke com.jsy.order.api.OrderRepaymentPlanFacade.viewPlan("SHT20171212000002")
{"msg":"还款计划生成失败","data":null,"status":"30046"}
elapsed: 68 ms.

可以以JSON格式传入对象参数

传入数组:

invoke com.jsy.order.api.OrderTrialFacade.getOrderListByTrial(["张芳","测试"])

参考:

Telnet 命令参考手册

接口测试 dubbo 接口测试技术

分布式系列 - dubbo服务telnet命令

o
粉丝 0
博文 500
码字总数 0
作品 0
私信 提问
加载中
请先登录后再评论。

暂无文章

SikuliX简介及安装

一、简单介绍 SikuliIDE和Sikuli Script就是现在的SikuliX,最新版本是SikuliX1.1.0, 部分兼容Sikuli JAVA API,支持Python和Ruby,SikuliX通过定位图像和键盘鼠标来操作GUI(图形化用户界面...

osc_r5t7sskd
56分钟前
6
0
Above the Median

Above the Median 农夫约翰把他的N(1 <= N <= 100,000)奶牛排在一排来衡量他们的高度,牛i有:高度H_I(1 <= H_I <= 1,000, 000,000)纳米 – 因为FJ认为他需要精确测量!他想选择一些连续...

osc_3k29rnjy
58分钟前
6
0
Above the Median

Above the Median 农夫约翰把他的N(1 <= N <= 100,000)奶牛排在一排来衡量他们的高度,牛i有:高度H_I(1 <= H_I <= 1,000, 000,000)纳米 – 因为FJ认为他需要精确测量!他想选择一些连续...

osc_8nnvoyb1
59分钟前
9
0
python3连接mysql 稍微进阶 + 日期处理

1.踩了个操作中文的坑,结果发现之前的文章中有强调了,在连接处加:charset="utf8" conn = pymysql.connect(host = '127.0.0.1', unix_socket = '/tmp/mysql.sock', user = 'root' , passwo......

osc_fipgtxy8
今天
6
0
Above the Median

Above the Median 农夫约翰把他的N(1 <= N <= 100,000)奶牛排在一排来衡量他们的高度,牛i有:高度H_I(1 <= H_I <= 1,000, 000,000)纳米 – 因为FJ认为他需要精确测量!他想选择一些连续...

osc_cj3zzdzw
今天
8
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部