XmlBlaster Logo

REQUIREMENT

admin.errorHandling

XmlBlaster Logo


Type NEW
Priority LOW
Status CLOSED
Topic XmlBlaster supports specific error handling and dead messages
Des
cription

When xmlBlaster experiences error or exception situations which it can't handle with its standard program flow (like throwing an exception back to the client) the problem is forwarded to the exception handler which usually publishes a dead message containing the lost message.

You can now implement a specific client which subscribes on the "__sys__deadMessage" topic to process the dead messages in your specific way.

XmlBlaster provides a little server side plugin called DeadMessageDumper which subscribes to dead messages and dumps them to a configurable directory.

Example
ANY

DeadMessageDumper

If you activate the DeadMessageDumper plugin in xmlBlasterPlugins.xml all dead messages are dumped for example to /tmp/xmlBlaster-deadMessages/2005-02-03_22_15_31_664.xml:

<plugin id='DeadMessageDumper' className='org.xmlBlaster.engine.DeadMessageDumper'>
   <action do='LOAD' onStartupRunlevel='7' sequence='1' onFail='resource.configuration.pluginFailed'/>
   <action do='STOP' onShutdownRunlevel='6' sequence='1'/>
   <attribute id='loginName'>_DeadMessageDumper</attribute>
   <attribute id='directoryName'>${java.io.tmpdir}${file.separator}xmlBlaster-deadMessages</attribute>
   <attribute id='password'>secret</attribute>
   <attribute id='forceBase64'>false</attribute>
</plugin>
     

The content of a dumped dead message file contains all detailed informations about the problem:

  <!-- Dump of topic 'Company_data.Woody' cause: -->
  <!-- Generating dead message
       'callback:/node/xmlBlaster_217_35_23_67_3412/client/xmlblast/-3/NORM/1107447908405000000/Company_data.Woody'
       from publisher=/node/xmlBlaster_217_35_23_67_3412/client/publisher/1 because delivery with queue 'null' failed:
       Mime access filter 'XPathFilter' for message 'Company_data.Woody/2005-02-03 17:23:44.022'
       from sender '/node/xmlBlaster_217_35_23_67_3412/client/publisher/1'
       to subscriber '/node/xmlBlaster_217_35_23_67_3412/client/xmlblast/-3' threw an exception,
       we don't deliver the message to the subscriber:
       errorCode=user.configuration message=#13159:13171
         Error in querying dom tree with query //root :
         errorCode=user.illegalArgument message=#13159:13171
         Could not parse xml: Expected "</dsafroot>" to terminate element starting on line 1. at line=40 column=-1
         in systemIDnull -->
<xmlBlaster>
 <publish>
 <qos>
  <subscribable/>
  <sender>/node/xmlBlaster_217_35_23_67_3412/client/publisher/1</sender>
  <expiration lifeTime='-1' forceDestroy='false'/>
  <rcvTimestamp nanos='1107447824022000000'/>
  <persistent/>
  <forceUpdate/>
  <route>
   <node id='xmlBlaster_217_35_23_67_3412' stratum='0' timestamp='1107447824022000000' dirtyRead='false'/>
  </route>
  <isPublish/>
  <topic readonly='false' destroyDelay='60000' createDomEntry='true'>
    <msgDistributor typeVersion='undef,1.0'/>
    <persistence relating='msgUnitStore' maxEntries='100000000' maxEntriesCache='10000'/>
    <queue relating='history' maxEntries='10' maxEntriesCache='10'/>
  </topic>
  <clientProperty name='__isErrorHandled' type='boolean'>true</clientProperty>
 </qos>
 <key oid='Company_data.Woody' contentMime='text/xml' contentMimeExtended='1.0'>
  <org.xmlBlaster><demo-1></demo-1></org.xmlBlaster>
 </key>
 <content size='946'><dsafroot><co_guid>1</co_guid>
<co_typ>L</co_typ>
<co_nr>10001</co_nr>
<co_status>18</co_status>
<co_sort>test</co_sort>
<co_str>Teststr. 5</co_str>
<co_email></co_email>
</root></content>
 </publish>
</xmlBlaster>
   

An administrator can edit the message and resend it using the xmlBlaster scripting client or any other customized tool. You need to remove all <qos> entries like <route> and <rcvTimestamp> before sending the message manually or use the command line setting -prepareForPublish true which does this for you:

java javaclients.script.XmlScript -session.name joe -prepareForPublish true -requestFile 2005-02-03_22_15_31_664.xml

Wrong sender address

One problem remains: The sender of the message changes to be the xml script client instead of the original sender. To allow sending a faked sender address in the QoS you can start xmlBlaster with this option:

java org.xmlBlaster.Main -xmlBlaster/acceptWrongSenderAddress/joe true.

It is possible to set this setting on cluster node level or on client session level using JMX, for example using the jconsole. Setting it on cluster node level allows ALL clients of this server instance to publish messages with a faked sender name, so use this with caution.

You could use a well known client in fail save mode and publish a first dummy message and than set acceptWrongSenderAddress to true for this login session:

java javaclients.script.XmlScript -session.name client/deadMessagePublisher/session/1 -dispatch/callback/retries -1 -prepareForPublish true -requestFile 2007-06-12_18_21_30_521.xml

Later send messages of client/deadMessagePublisher/session/1 are allowed to contain a different publisher address.

Configure

These parameters allow to configure the error handling.

Property Default Description Impl
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.

Todo
See API org.xmlBlaster.util.error.I_MsgErrorHandler
See API org.xmlBlaster.engine.MsgErrorHandler
See API org.xmlBlaster.client.ClientErrorHandler
See API org.xmlBlaster.engine.DeadMessageDumper

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

Back to overview