Telnet Command Reference

Telnet command reference in dubbo

Since 2.0.5 dubbo starts supporting to use telnet command to govern services.

How To Use

telnet localhost 20880

Or:

echo status | nc -i 1 localhost 20880

Supported Commands

The built-in telnet commands are listed below. Furthermore, it is possible to extend telnet commands, pls. refer to extend telnet command for more details.

ls

  1. ls: list services
  2. ls -l: list services in more details
  3. ls XxxService: list methods for the particular service
  4. ls -l XxxService: list methods for the particular service in more dtails

ps

  1. ps: list service ports
  2. ps -l: list service addresses
  3. ps 20880: show connection info for the particular port
  4. ps -l 20880: show connection info for the particular port in more details

cd

  1. cd XxxService: switch default service. When default service is set, service parameter can be ignored in all commands when it’s needed
  2. cd /: reset default service

pwd

pwd: show what current default service is

trace

  1. trace XxxService: trace method invocation once for the given service
  2. trace XxxService 10: trace method invocations 10 times for the given service
  3. trace XxxService xxxMethod: trace particular method invocation once for the given service
  4. trace XxxService xxxMethod 10: trace particular method invocations 10 times for the given service

count

  1. count XxxService: count method invocation once for the given service
  2. count XxxService 10: count method invocations 10 times for the given service
  3. count XxxService xxxMethod: count particular method invocation once for the given service
  4. count XxxService xxxMethod 10: count particular method invocation 10 times for the given service

invoke

  1. invoke XxxService.xxxMethod(1234, "abcd", {"prop" : "value"}): invoke particular method for the given service
  2. invoke com.xxx.XxxService.XxxService.xxxMethod(1234, "abcd", {"prop" : "value"}): invoke particular method for the given service
  3. invoke xxxMethod(1234, "abcd", {"prop" : "value"}): invoke particular method for the default service
  4. invoke xxxMethod({"name":"zhangsan","age":12,"class":"org.apache.dubbo.qos.legacy.service.Person"}) :When there is parameter overload, or the type conversion fails, you can specify the class to be converted by adding the class attribute
  5. When the parameter is Map<Integer, T> and the key type is Integer, it is recommended to specify the type. E.g:invoke com.xxx.xxxApiService({"3":0.123, "class":"java.util.HashMap"})

select 1

  1. select 1: used when the invoke command matches multiple methods, select the method to be called according to the prompt list

status

  1. status: show summarized status. This status summarizes statuses from all resources, and it shows OK when all resources are OK, shows ERROR when any resource has ERROR, and WARN when any has WARN.
  2. status -l: show status list

log 2

  1. log debug: modify logger level to debug
  2. log 100: examine the last 100 characters from the file logger

help

  1. help: show help for telnet commands
  2. help xxx: show help for particular telnet command

clear

  1. clear: clear screen
  2. clear 100: only clear particular lines on the screen

exit

exit: exit current telnet session

shutdown 1

  1. shutdown: shutdown dubbo application
  2. shutdown -t 1000: delay 1000 ms to shutdown dubbo application

  1. support since 2.7.1 ↩︎ ↩︎

  2. support since 2.0.6 ↩︎