REQUIREMENT admin.checkpoint |
Type | NEW |
Priority | HIGH |
Status | CLOSED |
Topic | Trace the message flow at pre-defined checkpoints | ||||||||||||||||||||||||||||||||
Des cription |
Introduction If you need more control about where your messages are ending up you should consider to switch on this plugin. On several checkpoints inside the xmlBlaster server you can output a message passing by into a log file. Activate the plugin The first step is to setup the server side configuration and load the plugin: xmlBlasterPlugins.xml: <plugin create='true' id='Checkpoint' className='org.xmlBlaster.util.checkpoint.Checkpoint'> <action do='LOAD' onStartupRunlevel='1' sequence='1' onFail='resource.configuration.pluginFailed'/> <action do='STOP' onShutdownRunlevel='0' sequence='1'/> <attribute id='filterClientPropertyKey'>wfguid</attribute> <attribute id='showAllMessages'>true</attribute> <attribute id='xmlStyle'>true</attribute> <attribute id='showAllClientProperties'>false</attribute> <attribute id='log4j.configuration'>/srv/conf/log4j.properties</attribute> <attribute id='log4j.debug'>false</attribute> </plugin>
Note that The output is using the apache commons logging framework. Configure output with log4j #log4j.properties: log4j.rootLogger=DEBUG, CHECKPOINT # Create new file on midnight log4j.appender.CHECKPOINT=org.apache.log4j.DailyRollingFileAppender log4j.appender.CHECKPOINT.File=${user.home}/checkPointLogs/checkpoint.log log4j.appender.CHECKPOINT.DatePattern='.'yyyy-MM-dd # CHECKPOINT uses PatternLayout. see http://logging.apache.org/log4j/1.2/apidocs/index.html # %c == xmlBlaster.checkpoint.publish.ack log4j.appender.CHECKPOINT.layout=org.apache.log4j.PatternLayout log4j.appender.CHECKPOINT.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %t RL - -: %m%n #----------------------------------------------------------------------------- Configure output with java.util.logging logging.properties: #----------------------------------------------------------------------------- # Trace flow of messages # See javadoc of xmlBlaster/src/java/org/xmlBlaster/util/checkpoint/Checkpoint.java # Checkpoints: "publish.enter", "publish.ack", "update.queue.add", "update.ack" # on cluster-client side: "client.publish.enter", "client.publish.ack" # INFO dumps the most important data # FINEST dumps the complete message # OFF switches a checkpoint off xmlBlaster.checkpoint=INFO xmlBlaster.checkpoint.handlers=org.xmlBlaster.util.log.FileHandler2 xmlBlaster.checkpoint.useParentHandlers=false # Dump complete incoming message #xmlBlaster.checkpoint.publish.ack.level=FINEST # Don't log checkpoint "update.queue.add" #xmlBlaster.checkpoint.update.queue.add.level=OFF # Standard logging for "update.ack" #xmlBlaster.checkpoint.update.ack.level=INFO org.xmlBlaster.util.log.FileHandler2.pattern = %h/logs/xmlBlasterCheckpoint%u%g.log org.xmlBlaster.util.log.FileHandler2.limit = 1000000 org.xmlBlaster.util.log.FileHandler2.count = 10 org.xmlBlaster.util.log.FileHandler2.formatter = org.xmlBlaster.util.log.XbFormatter #----------------------------------------------------------------------------- You can copy the logging.properties to your home directory or pass it on command line: Start xmlBlaster: java -Dcom.sun.management.jmxremote -Djava.util.logging.config.file=$XMLBLASTER_HOME/config/logging.properties org.xmlBlaster.Main -cluster.node.id heron Publish some messages: java javaclients.HelloWorldPublish -session.name Publisher/1 -numPublish 1000 -clientProperty[wfguid] 234345667777 Now you can see the message flow in the logging files in $user.home/logs (one log entry is one line) 2007-10-21 13:48:14.260 INFO 12-XmlBlaster.SOCKET.tcpListener-Publisher org.xmlBlaster.util.checkpoint.Checkpoint passingBy: <cp>publish.ack</cp> <topicId>Hello</topicId> <wfguid>234345667777</wfguid> <sender>client/Publisher/1</sender> 2007-10-21 13:48:20.860 INFO 13-XmlBlaster.DispatchWorkerPool.marcel-5 org.xmlBlaster.util.checkpoint.Checkpoint passingBy: <cp>update.ack</cp> <topicId>Hello</topicId> <wfguid>234345667777</wfguid> <sender>client/Publisher/1</sender> <destination>client/Subscribe/1</destination> If you prefer a more readably view without xml set 2007-10-21 14:32:42.269 INFO 12-XmlBlaster.SOCKET.tcpListener-Publisher org.xmlBlaster.util.checkpoint.Checkpoint passingBy: [cp=publish.ack] [topicId=Hello] [wfguid=234345667777] [sender=client/Publisher/1] [destination=client/Subscribe/1] The logging output has an ISO 8601 formatted date and time string at the beginning of each line which allows easy sorting of the logging outputs.
The plugin can be configured during runtime using JMX, typically you choose If the Checkstyle plugin does not fullfill your requirements you can extend the class or write a specific one for your needs. The xmlBlaster code contains following checkpoints
|
||||||||||||||||||||||||||||||||
Configure |
Configuration of the Checkpoint.java plugin (since v1.6.2)
NOTE: Configuration parameters are specified on command line (-someValue 17) or in the
xmlBlaster.properties file (someValue=17). See requirement "util.property" for details. |
||||||||||||||||||||||||||||||||
See API | org.xmlBlaster.util.checkpoint.Checkpoint | ||||||||||||||||||||||||||||||||
See API | org.xmlBlaster.util.log.XbFormatter | ||||||||||||||||||||||||||||||||
See | Java logging API |
This page is generated from the requirement XML file xmlBlaster/doc/requirements/admin.checkpoint.xml