XmlBlaster has an internal command interface which allows to monitor and control the server. You can connect to this command interface with arbitrary administration protocols like SNMP, telnet, JMX or xmlBlaster-command-messages.
To understand the command syntax imagine a simple xml representation of xmlBlaster nodes (an xmlBlaster node is an xmlBlaster server instance in a cluster environment, read the cluster requirement for more informations). You can zoom into the server structure to examine any detailed data, some of the settings are changeable in hot operation:
|
As you have probably noticed, the tree syntax has class names like node or client and identifier which are instance names like heron or joe.
Lets have a look at the xmlBlaster cluster node heron. This is
an xmlBlaster server running somewhere on the net (server.mycomp.com:3412).
heron has its own attributes like uptime and freeMem
which are leafs in the tree. In addition heron has tags which
have children themselves, more exact the tags:
The cb in for example cbSessionId is the abbreviation for callback.
Command | Description | MOM | telnet | SNMP | JMX | Impl |
---|---|---|---|---|---|---|
GET | We can read all attributes | get() | get | get | getAttributes() | |
SET | We can write/change selective attributes | publish() | set | set | setAttributes() | |
SUBSCRIBE | We can subscribe for change events on selective attributes | subscribe() | - | trap | Notification | * |
POLL | We can ask xmlBlaster to send us the current value of an attribute for example every 10 seconds (every specified amount of cycle time) | subscribe() | poll | trap | Notification | * |
SCHEDULE | We can ask xmlBlaster to send us the current value of an attribute on fixed times, for example always at midnight | subscribe() | - | trap | Notification | * |
The column Impl states if the feature is implemented.
For JMX the DynamicMBean and Notification interface is used.
*
This feature is supported by the EventPlugin, please read the requirement
admin.events for details on how to activate and configure it.
The following table gives an overview of the query syntax, it is URL conforming to allow direct queries from a browser and it is simple to allow typing it into a telnet terminal.
Command | Description | Impl |
---|---|---|
/node/?numNodes | Query the number of xmlBlaster cluster nodes (running xmlBlaster instances) | |
/node/heron/?freeMem | Query the free memory in bytes | |
/node/heron/?runlevel=3 | Switch run level of heron to 3 (STANDBY) | |
/node/heron/?numClients | How many clients are logged in to heron | |
set ?dump=ServerDump.xml | Create a server dump | |
/node/heron/client/joe/?sessionList | Retrieve the public session IDs of joe (if joe is logged in three times, there will be three entries) | |
client/joe/?sessionList | Same as above but relative addressed | |
client/joe/session/1/?uptime | How long is session ID 17 logged in (in seconds) | |
client/*/?uptime | The uptime of all users (in seconds). Wildcards are not implemented yet. | |
client/joe/session/1/?cbQueueMaxMsgs=30000 | Change max. callback queue size of client joe with login session ID 17 to 30 thousand messages | |
client/joe/session/1/?cbQueueNumMsgs | Access the current number of messages in joe's callback queue waiting to be delivered | |
client/joe/session/-5/?subscriptionList | Show all subscriptions 'joe' has made (with his login session '-5') | |
client/joe/session/-5/?numUpdate | How many update messages were delivered to joe's session '-5' since server startup? | |
/node/heron/sysprop/?java.vm.version | Access the JDK version | |
sysprop/?user.language=es | Change the language to spanish (relative addressed) | |
logging/?org.xmlBlaster=WARNING | Switch off INFO level logging | |
logging/?org.xmlBlaster.engine.RequestBroker=FINE | Switch on trace mode for the xmlBlaster core class | |
/node/heron/?numTopics | How many messages are currently in heron | |
/node/heron/topic/?Hello | Return the complete message (oid=Hello) | |
topic/Hello/?peekHistoryMessages=2 | Access max. two messages with key-oid="Hello" | |
/node/heron/topic/Hello/?content=How are you | Change the message content of the message with key-oid="Hello" to "How are you" | |
/node/heron/topic/Hello/?toXml | Returns the topic dump | |
/node/heron/topic/Hello/?key.contentMime | Return the MIME type of this message | |
client/joe/session/1/?killSession | Kills the first session of joe (force logout) | |
client/joe/session/1/?dispatcherActive | tells if the DispatchManager of the specified session is active for asynchronous dispatch | |
client/joe/session/1/?dispatcherActive=true | tells the DispatchManager of the specified session to become active | |
?serverTimestamp | The current time of the server, for example "2005-03-21 11:18:12.622" |
You can address an attribute with global scope /node/heron/client/joe/?uptime or with relative scope client/joe/?uptime. The relative query assumes the current xmlBlaster node you are connected to.
Responses for telnet clients are described in the requirement admin.telnet.
Mom clients receive messages with the value in the message content, see requirement admin.messages.
Here are example invocations from different clients:
Protocol | Example | Description | Impl |
---|---|---|---|
MoM clients | con.get( "<key oid='__cmd:?freeMem'/>", "<qos/>") |
The token __cmd: marks the oid to be used as a command. Here we have used relative addressing, absolute __cmd:/node/heron/?freeMem would be identical. For example try (in one line) java org.xmlBlaster.client.reader.GetMessage -oid __cmd:?clientListHere we change the logging level of the corba plugin: java org.xmlBlaster.client.feeder.PublishFile -xmlKey "<key oid='__cmd:logging/?org.xmlBlaster.util=FINER'/>"Exit xmlBlaster with exit value 9: java org.xmlBlaster.client.feeder.PublishFile -xmlKey "<key oid='__cmd:?exit=9'/>" |
|
telnet | get ?runlevel set /node/heron/?runlevel=3 set logging/?org.xmlBlaster=WARNING |
With telnet you give the command get or set followed by the query (separated with a blank) | |
SNMP | snmpget -v 1 -c public 192.168.1.4 1.3.6.1.4.1.11662.1.2.1.3 |
-c is community password, usually 'public', the IP is where the master agent runs
1.3.6.1.4.1.11662 xmlBlaster 1.3.6.1.4.1.11662.1 objects 1.3.6.1.4.1.11662.2 traps 1.3.6.1.4.1.11662.1.2.1.3 objects momTable momEntry uptime |
|
JMX | j org.xmlBlaster:nodeClass=node, node="xmlBlaster_192_168_1_25_3412"/action=getFreeMemStr |
On the command line of a running server you can use the shown command. Alternatively you can use any other GUI JMX tool as described in requirement admin.jmx, typically you will use jconsole. |
connect <loginName> <password>command on startup.
Here is an example of a complete and valid URI, we should try not to break this syntax with our query language. You can use the similar syntax for building administrative html pages as described in requirement admin.http.
http://joe:mypasswd@www.xmlBlaster.org:3412/myPath/?key.oid=MyMsg&key.mime='text/plain'#myFragment Protocol: http Host: www.xmlBlaster.org Port: 3412 File: /myPath/?key.oid=MyMessage Path: /myPath/ Query: key.oid=MyMessage Ref: myFragment UserInfo: joe:mypasswd |
The problem is that the UserInfo is cut away from the browser, we need to pass it somewhere in the path.
Here is a command line example of controlling message delivery to a subscriber joe/1, open three console windows and start the server, a publisher and a subscriber:
java org.xmlBlaster.Main java javaclients.HelloWorldSubscribe -session.name joe/1 (hit a key to subscribe ...) java javaclients.HelloWorldPublish -numPublish 100
Publish some messages to see them arriving at the subscriber, now we deactivate the delivery of messages using telnet:
telnet localhost 2702 127.0.0.1 : eecchhoo ooffff 127.0.0.1 : connect jack secret 127.0.0.1 : set client/joe/session/1/?dispatcherActive=false
If you now publish more messsages they won't arrive at the subscriber, now activate delivery again:
127.0.0.1 : set client/joe/session/1/?dispatcherActive=true
and all missing messages will arrive.
The same you can do over the jconsole GUI or by publishing the administrative command from command line:
java javaclients.HelloWorldPublish -oid __cmd:client/joe/session/1/?dispatcherActive=true
The available commands are marked as R=readable, W=writable, S=subscribable T=schedulable, P=pollable
If you want to change a value, you need to use a publish() message, or with telnet you would use set, for SNMP you use a set command as well.
Command | Type | Read/Write | Description | Implemented |
---|---|---|---|---|
client/joe/?uptime | int | R | Get the number of seconds the user is logged in | |
logging/?org.xmlBlaster.util.queue=FINE | boolean | R/W | Monitor or change the log level, but only for queuing issues | |
TODO |
See the API links of I_AdminNode, I_AdminSubject, I_AdminSession below of the available core properties to monitor or configure