XmlBlaster Logo



XmlBlaster Logo

Type NEW
Priority LOW
Topic You can administer XmlBlaster using a telnet client
There is support to access xmlBlaster with telnet. You can for example query the free memory of the server JVM or shutdown xmlBlaster.

This is based on Remote Console of the WTTools project.

The plugin architecture of remotecons allowed us to add xmlBlaster specific functionality like internal state queries or setting of properties.

The default port to access xmlBlaster is 2702, configuring the port to 0 switches telnet access off (see below).

The query syntax is described in the admin.commands requirement.

How does the return value look like?

Responses of attributes have the key and the value, separated to lines. Messages are returned XML encoded.
The following table shows the return values of get invocations. The 'Impl' column marks the implemented features.

Command Return Description Impl
get ?numNodes
The separator between the key and the value is '=' yes
get client/*/?uptime
The query matched three users, the lines are seperated by cr and lf (Wildcards are currently not supported) no
get ?clientList
The clientList is one attribute, containing the list of known clients yes
get client/joe/?sessionList
joe is logged in once and has the public session id 1 yes
get client/joe/?subjectQueueNumMsgs
There are 780 messages in the subject queue of joe yes
get client/joe/1/?cbQueueNumMsgs
There are 5 messages in the callback queue of the login session 1 of user joe yes
get client/joe/1/?numUpdate
The login session 1 of user joe has delivered 7537 messages to the callback client up to now yes
get ?serverTimestamp
2005-03-21 11:31:35.044
The current time on the server yes
get topic/Hello/?topicXml
<key oid='Hello' contentMime='text/xml'>
The XML markup of the topic yes
get topic/Hello/?numSubscribers 4 The number of subscribers for this topic yes
get topic/Hello/?numOfHistoryEntries 3 Number of queued back history entries for this topic yes
get topic/Hello/?subscribers /node/heron/client/joe/1, /node/heron/client/jack/-5, /node/heron/client/jack/-7 The list of subscribers for the topic 'Hello' yes
get topic/Hello/?peekHistoryMessages=2

<MsgUnit index='0'>

 <key oid='Hello' contentMime='text/xml'>
  <content size='4'>Hi-3</content>

  <expiration lifeTime='-1' forceDestroy='false'/>
  <rcvTimestamp nanos='1141465549697000000'/>
<MsgUnit index='1'>

 <key oid='Hello' contentMime='text/xml'>
  <content size='4'>Hi-2</content>

  <expiration lifeTime='-1' forceDestroy='false'/>
  <rcvTimestamp nanos='1141465548969000000'/>
Access at most 2 messages from history queue yes
get topic/Hello/?historyQueueEntries= "maxEntries=3&consumable=true&waitingDelay=0"

<MsgUnit index='0'>

 <key oid='Hello' contentMime='text/xml'>
  <content size='4'>Hi-3</content>

  <rcvTimestamp nanos='1141465549697000000'/>
Query topic with a consuming tag set, it returns immediately even if not 3 messages are available. Setting waitingDelay=2000 would wait for 2 seconds and return before if 3 messages are available. yes
get _topic/?Hello
  <key oid='Hello' contentMime='text/plain'/>
  <content>How are you</content>
  <qos><rcvTimestamp nanos='1291'/></qos>
The query returns exactly one message. deprecated: '_topic' uses the old implementation up to xmlBlaster 1.1.1, use peekHistoryMessages instead. yes
get _topic/?__sys__UserList
  <key oid='__sys__UserList'>
   <state id='OK'/>
   <rcvTimestamp nanos='1291'/>
The query returns exactly one message deprecated: '_topic' uses the old implementation up to xmlBlaster 1.1.1, use peekHistoryMessages instead. yes
get org.xmlBlaster:nodeClass=node,node="heron"/ action=getFreeMemStr
1.926 MBytes
All commands starting with 'org.xmlBlaster:' are treated as JMX commands and are forwarded to the JMX handler. The server be started with switched on JMX and in the above example should be named 'heron':
java -Dcom.sun.management.jmxremote org.xmlBlaster.Main -cluster.node.id heron

The next table shows the return values of set invocations:

Command Return Description
set client/joe/1/?sessionTimeout=2000000 /node/heron/client/subscribe/1/?sessionTimeout=2000000 Similar as the request
set client/publish/1/?addRemoteProperty=aKey&aValue /node/heron/client/publish/1/? addRemoteProperty=aKey&aValue Similar as the request
set client/publish/1/?addRemoteProperty=someKey errorCode=user.illegalArgument message=#1.1.1 wrong number of arguments: '1' but should be '2' An error as the method addRemotProperty(String,String) expects two arguments

Start xmlBlaster (port 2702 is default for telnet access). We configure the server to have a nice and short name heron:
  java org.xmlBlaster.Main -cluster.node.id heron
and try a
  telnet myHost 2702
Replace myHost with the IP where xmlBlaster runs.

Type help for a usage list.

Now lets login to play:

  CMD>connect admin secret

  Successful login for user admin, session timeout is  [ 10 min 0 millis ]

Example to query the home directory of the user which started xmlBlaster and the current free memory in the server, the last example queries how many users are currently known in the server:

  CMD>get sysprop/?user.home


  CMD>get ?freeMem


  CMD>get /node/heron/?numClients


Here is an example change the logging level of the authentication modules:

  CMD> set logging/?org.xmlBlaster.engine=FINE


This example sets a variable with replacement (currently not very useful):

  CMD> set sysprop/?myTmpPath=${user.home}${file.separator}backup


Now we kill the login session '1' of client 'joe'. To test it you should start a client with login name joe first.

  CMD> get client/joe/1/?killSession

This would kill all login sessions of client 'joe'.

  CMD> get client/joe/?killClient

Now lets query and change the run level:

  CMD> get ?runlevel


  CMD> set ?runlevel=3 


Please read the admin.commands requirement for a description of the command syntax.

any << help
remotecons.wttools.ConnectionServer$InternalCommands >> 
  echo           - switch 'echo' mode (for windows telnet is really needed)
  quit           - close connection to server
  who            - list all active connections
  close n        - close active connection number 'n'
  help [command] - display this message info

org.xmlBlaster.engine.admin.extern.TelnetGateway >> 
  XmlBlaster telnet administration
   connect [name] [passwd]  Login with you login name and password
   get [query]              Get property or xmlBlaster state
   set [query]              Set a property or change xmlBlaster setting
   time                     Display current time on server
   gc                       Run System.gc() command on remote system
   mem [total|free]         Display amount of memory on remote system
   exit                     Call System.exit(0) on remote system
  For query syntax see
Property Default / Example Description Implemented
admin.remoteconsole.port 2702 Choose the port where xmlBlaster listens for telnet requests, 0 switches telnet access off. Port 2702 is a good port to try.
java org.xmlBlaster.Main
         -cluster.node.id heron
         -admin.remoteconsole.port 2702
admin.remoteconsole.sessionTimeout 3600000 Auto logout after given milli seconds, defaults to one hour. yes

NOTE: Configuration parameters are specified on command line (-someValue 17) or in the xmlBlaster.properties file (someValue=17). See requirement "util.property" for details.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.


Most is done, testsuite is missing.

See http://wttools.sourceforge.net/remotecons/package.html
See API org.xmlBlaster.engine.admin.extern.TelnetGateway
See REQ admin
See REQ admin.commands
See REQ admin.jmx

This page is generated from the requirement XML file xmlBlaster/doc/requirements/admin.telnet.xml

Back to overview