使用telnet进行Dubbo接口测试
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
ls
: 显示服务列表ls -l
: 显示服务详细信息列表ls XxxService
: 显示服务的方法列表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×tamp=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×tamp=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×tamp=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×tamp=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×tamp=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×tamp=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×tamp=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×tamp=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×tamp=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×tamp=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:
ps
: 显示服务端口列表ps -l
: 显示服务地址列表ps 20880
: 显示端口上的连接信息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:
trace XxxService
: 跟踪 1 次服务任意方法的调用情况trace XxxService 10
: 跟踪 10 次服务任意方法的调用情况trace XxxService xxxMethod
: 跟踪 1 次服务方法的调用情况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(["张芳","测试"])