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.
What data can we monitor and control?
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:
<xmlBlaster>
<numNodes>5</numNodes>
<nodeList>heron,avalon,golan,frodo,bilbo</nodeList>
<node id='heron'>
<startupDate>2005-03-20 11:19:12.322</startupDate>
<uptime>34000</uptime> <!-- sec -->
<runlevel>9</runlevel>
<!-- runLevel=0 HALTED -->
<!-- runLevel=3 ADMIN -->
<!-- runLevel=6 CLEANUP -->
<!-- runLevel=9 RUNNING -->
<usedMem>6200000</usedMem> <!-- [bytes] -->
<freeMem>1900000</freeMem> <!-- currently free in JVM [bytes] -->
<maxFreeMem>13000000</maxFreeMem> <!-- free, totally allocatable by JVM [bytes] -->
<instanceId>/node/heron/instanceId/33470080380</instanceId>
<nodeId>heron</nodeId>
<version>0.84</version>
<revisionNumber>14544</revisionNumber>
<hostname>server.mycomp.com</hostname> <!-- bootstrap -->
<port>3412</port>
<buildTimestamp>06/17/2002 01:59 PM</buildTimestamp>
<buildJavaVendor>Sun Microsystems Inc.</buildJavaVendor>
<buildJavaVersion>1.3.1-beta</buildJavaVersion>
<serverTimestamp>2005-03-21 11:31:35.044</serverTimestamp>
<serverTimestampMillis>1111401087533</serverTimestampMillis>
<lastWarning><![CDATA[JdbcDriver-/node/heron] Couldn't initialize driver 'org.firebirdsql.jdbc.FBDriver',
please check your CLASSPATH]]></lastWarning>
<lastError><![CDATA[]]></lastError>
<versionInfo><![CDATA[os.name=Linux, os.version=2.6.13-15-default, java.vm.vendor=Sun Microsystems Inc.,
java.vm.version=1.5.0_05-b05, os.arch=i386], ...></versionInfo>
<see>http://www.xmlBlaster.org</see>
<gc/> <!-- run garbage collector in xmlBlaster JVM -->
<exit/> <!-- exit xmlBlaster server -->
<!-- dump internal state (similar to this markup) -->
<dump>heronDump.xml</dump>
<plugin id='SOCKET-admin'
className='org.xmlBlaster.protocol.socket.SocketDriver'>
<port>69000</port>
</plugin>
<!-- A typical plugin which is loaded by client request -->
<plugin id='dispatchPriority'
className='org.xmlBlaster.util.dispatch.plugins.prio.PriorizedDispatchPlugin'
jar='/tmp/my.jar'>
<attribute id='config'>
<![CDATA[
<msgDispatch defaultStatus='64k' defaultAction='send'>
<onStatus oid='_bandwidth.status' content='64k' defaultAction='destroy'>
<action do='send' ifPriority='7-9'/>
<action do='queue' ifPriority='2-6'/>
</onStatus>
<onStatus oid='_bandwidth.status' content='2M'>
<action do='send' ifPriority='0-9'/>
</onStatus>
</msgDispatch>
]]>
</attribute>
</plugin>
<!-- /node/heron/plugin/SOCKET/attribute/port=6901 -->
<!-- /node/heron/plugin/SOCKET/action/LOAD/onStartupRunlevel=3 -->
<!-- /node/heron/plugin/SOCKET/action/LOAD/sequence=5 -->
<plugin id='SOCKET' className='org.xmlBlaster.protocol.socket.SocketDriver'>
<attribute id='port'>6901</attribute>
<action do='LOAD' onStartupRunlevel='3' sequence='5'/> <!-- 0 first -->
<action do='STOP' onShutdownRunlevel='2' sequence='4'/> <!-- 0 first -->
</plugin>
<plugin id='queueCACHE' className='org.xmlBlaster.util.queue.cache.CacheQueueInterceptorPlugin'>
<attribute id='transientQueue'>queueRAM</attribute>
<attribute id='persistentQueue'>queueJDBC</attribute>
</plugin>
<plugin id='queueRAM' className='org.xmlBlaster.util.queue.ram.RamQueuePlugin'/>
<plugin id='queueJDBC' className='org.xmlBlaster.util.queue.jdbc.JDBCQueueCommonTablePlugin'>
<attribute id='url'>jdbc:oracle:thin:@localhost:1521:noty</attribute>
<attribute id='user'>joe</attribute>
<attribute id='password'>secret</attribute>
<attribute id='connectionBusyTimeout'>90000</attribute>
<attribute id='maxWaitingThreads'>300</attribute>
</plugin>
<plugin id='storageCACHE' className='org.xmlBlaster.engine.msgstore.cache.PersistenceCachePlugin'>
<attribute id='transientQueue'>storage:RAM</attribute>
<attribute id='persistentQueue'>storage:JDBC</attribute>
</plugin>
<plugin id='storageRAM' className='org.xmlBlaster.engine.msgstore.ram.MapPlugin'/>
<plugin id='storageJDBC' className='org.xmlBlaster.engine.msgstore.cache.PersistenceCachePlugin'>
<attribute id='url'>jdbc:oracle:thin:@localhost:1521:noty</attribute>
<attribute id='user'>joe</attribute>
<attribute id='password'>secret</attribute>
<attribute id='connectionBusyTimeout'>90000</attribute>
<attribute id='maxWaitingThreads'>300</attribute>
</plugin>
<numClients>4</numClients>
<maxClients>10000</maxClients>
<clientThresholdOverflow type='event'/>
<clientList>joe,jack,averell,william</clientList>
<client id='joe'>
<uptime>10050</uptime>
<state>ALIVE</state>
<killClient/>
<queue id='subject'> <!-- PtP queue -->
<plugin refid='queueCACHE'/>
<numEntries>247</numEntries>
<numBytes>467900</numBytes>
<maxEntries>1000</maxEntries>
<maxBytes>2000000</maxBytes>
</queue>
<numSessions>2</numSessions>
<maxSessions>10</maxSessions>
<sessionThresholdOverflow type='event'/>
<sessionList>-3,17</sessionList>
<session id='-3'>
<uptime>10050</uptime>
<killSession/>
<numPublish>4</numPublish>
<numGet>7</numGet>
<numSubscribe>3</numSubscribe>
<numUnSubscribe>3</numUnSubscribe>
<numErase>0</numErase>
<numUpdate>614050</numUpdate>
<dispatch id='callback' sessionId='4e56890ghdFzj0'
pingInterval='10000' retries='-1' delay='10000'
oneway='false'>
<plugin refid='dispatchPriority'/>
<burstMode collectTime='400' />
<compress type='gzip' minSize='3000'/>
<ptp>true</ptp>
<queue id='callback'>
<plugin refid='queueCACHE'/>
<numEntries>7</numEntries>
<numBytes>90023</numBytes>
<maxEntries>1000</maxEntries>
<maxBytes>2000000</maxBytes>
<maxEntriesCache>100</maxEntriesCache>
<maxBytesCache>200000</maxBytesCache>
<threshold>80</threshold> <!-- 80% -->
<thresholdOverflow type='event'/> <!-- a trap -->
<clearAction>DEAD_MESSAGE | DISCARD</clearAction>
<onOverflow>DEAD_MESSAGE</onOverflow>
<entry id='556643'>
<topic refid='hello'>
<entry refid='1046976320144000020'/>
</topic>
</entry>
</queue>
<address>
<plugin refid='SOCKET'/>
myHost.com:3098
</address>
</dispatch>
<subscriptionList>__subId:3,__subId:XPATH2</subscriptionList>
<subscriptionDump>[The XML dump of all subscription informations]</subscriptionDump>
</session> <!-- -3 -->
<session id='17'>
...
</session>
</client> <!-- joe -->
<client id='jack'>
...
</client>
<!-- System properties, xmlBlaster.properties and
command line arguments -->
<numSysprop>117</numSysprop>
<syspropList>java.io.tmpdir,java.vm.version,...</syspropList>
<sysprop id='java.io.tmpdir'>/tmp</sysprop>
<sysprop id='java.vm.version'>1.3.1</sysprop>
<sysprop id='user.language'>es</sysprop>
<sysprop id='Persistence.Path'>/home/mom/data</sysprop>
<sysprop id='logFile'>/var/log/xmlBlaster-heron.log</sysprop>
...
<!-- xmlBlaster messages -->
<numTopics>7140</numTopics>
<topicList>hello,radar.track,myMessage,...</topicList>
<topic id='hello' contentMime='text/plain'>
<state>ALIVE</state>
<persistence id='msgUnitStore'>
<plugin refid='${QueuePluginCache}'/>
<numEntries>7</numEntries>
<numBytes>90023</numBytes>
<maxEntries>1000</maxEntries>
<maxBytes>2000000</maxBytes>
<maxEntriesCache>100</maxEntriesCache>
<maxBytesCache>200000</maxBytesCache>
<entry id='1046976320144000000'> <!-- history entries -->
<key oid='hello' contentMime='text/plain'/>
<content>Hi world</content>
<qos>
<persistent/>
<sender>/node/heron/client/jack</sender>
<expiration lifeTime='-1'/>
<rcvTimestamp nanos='1046976320144000000'/>
</qos>
</entry>
<entry id='1046976320144000020'>
<key oid='hello' contentMime='text/plain'/>
<content>Bye world </content>
<qos>
<sender>/node/heron/client/jack</sender>
<expiration lifeTime='-1'/>
<rcvTimestamp nanos='1046976320144000020'/>
</qos>
</entry>
</persistence>
<queue id='history'>
<plugin refid='${QueuePluginCache}'/>
<numEntries>7</numEntries>
<numBytes>90023</numBytes>
<maxEntries>10</maxEntries>
<maxBytes>2000000</maxBytes>
<clearAction>DISCARD</clearAction>
<entry id='34455'>
<topic refid='hello'>
<entry refid='1046976320144000000'/>
</topic>
</entry>
<entry id='6643'>
<topic refid='hello'>
<entry refid='1046976320144000020'/>
</topic>
</entry>
</queue>
<subscriptionList id='__subId:3'/>
</topic>
<topic id='radar.track'>
<state>UNREFERENCED</state>
...
</topic>
<subscriptionList>__subId:3,__subId:XPATH2</subscriptionList>
<subscription id='__subId:3'
sessionName='/node/heron/client/joe/session/-3'
topicId='hello'
creationTime='Mar 7, 2003 6:33:14 PM'/>
<subscription id='__subId:XPATH2' oid='//key//sport'
creationTime='Mar 12, 2003 10:53:27 AM'>
<subscription id='__subId:XPATH2:3' topicId='soccer'/>
<subscription id='__subId:XPATH2:4' topicId='tennis'/>
<subscription id='__subId:XPATH2:5' topicId='admiral cup'/>
<subscription>
</node> <!-- heron -->
<node id='avalon'>
...
</node>
</xmlBlaster>
|
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:
-
client Allows you to survey the logged in clients
-
sysprop Inspect the system properties, xmlBlaster.properties and command line arguments
-
topic Examine or manipulate the messages in xmlBlaster
The cb in for example cbSessionId is the abbreviation for callback.
What is allowed to do with these attributes?
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.
How can we query these attributes?
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.
How does the return value look like?
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.
How can we use these commands?
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:?clientList
Here 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. |
|
How does authentication work?