Setting Up a Messaging API Event Handler

Many external applications require notification of events that occur in the Transaction Server. These notifications are sent using a specific type of event handler, called the Messaging API event handler. Messaging API event handlers are configured in the Transaction Server Scheduler.xml file.

The Messaging API event handlers use the standard event XML with additional PARAMETER tags. The parameter tags are required to specify where the message should be sent. General Messaging API Event Handler Parameters describes the parameters that are common to all of the Messaging API events and must be set. Instead of specifying these common parameters for each event, use the PARAMETERSET tag in the scheduler XML file or use a separate parameter file. The separate parameter file has the same format as a Java™ properties file.

The following example shows the parameters for a typical event handler:
<EVENT>
   <NAME>Example Messaging API Event Handler</NAME>
   <TYPE>PaymentExceptionChange</TYPE>
   <EXEC>
      com.ibm.paydir.ima.txsvr.event.appbridge.PaymentExceptionEventHandler
   </EXEC>
   <PARAMETER name="sourceId">TxsServer001</PARAMETER>
   <PARAMETER name="destinationID">Auto Adjust</PARAMETER>
   <PARAMETER name="jmsQmgrHostname">localhost</PARAMETER>
   <PARAMETER name="jmsQmgrChannel">SYSTEM.DEF.SVRCONN</PARAMETER>
   <PARAMETER name="jmsQmgrPort">1414</PARAMETER>
   <PARAMETER name="jmsClient">false</PARAMETER>
   <PARAMETER name="jmsQmgrName">FTM.QMANAGER</PARAMETER>
   <PARAMETER name="jmsSendQueue">FXH.AUTOADJUST.INPUT.QUEUE</PARAMETER>
   <PARAMETER name="jmsReplyQueue">FXH.TRANSSERVER.INPUT.QUEUE</PARAMETER>
</EVENT>
The following example shows how to use the PARAMETERSET and PARAMETERREF tags in the scheduler XML. In the example, one or all of the PresentmentStateChange, PresentmentColumnChange, and PresentmentGroupColumnChange events are being handled by the PresentmentStatesEventHandler.
Note: PARAMETERSET tag sets can be used by more than one EVENT stanza.
<PARAMETERSET name="schedulerReferenceProperties">
    <PARAMETER name="jmsQmgrName">${QMGR_NAME}</PARAMETER>
    <PARAMETER name="jmsUserId">${QMGR_USER}</PARAMETER>
    <PARAMETER name="jmsPassword">${QMGR_PASSWORD}</PARAMETER>
    <PARAMETER name="jmsReplyQueue">FXH.TRANSSERVER.INPUT.QUEUE</PARAMETER>
    <PARAMETER name="jmsKeyStore">${NEW_KSTORE_PATH}</PARAMETER>
    <PARAMETER name="jmsKeyStorePassword">${KSTORE_PASSWORD}</PARAMETER>
    <PARAMETER name="jmsTrustStore">${NEW_TSTORE_PATH}</PARAMETER>
    <PARAMETER name="jmsKeyStoreFormat">PKCS12</PARAMETER>
    <PARAMETER name="jmsTrustStoreFormat">JKS</PARAMETER>
    <PARAMETER name="jmsTrustStorePassword">${TSTORE_PASSWORD}</PARAMETER>
    <PARAMETER name="jmsReplyTimeout">1000</PARAMETER>
</PARAMETERSET>

<PARAMETERSET name="sendToDistribution">
    <PARAMETER name="destinationID">Distribution</PARAMETER>
    <PARAMETER name="jmsSendQueue">FXH.DISTRIBUTION.INPUT.QUEUE</PARAMETER>
</PARAMETERSET>

<PARAMETERSET name="syncReplyQueue">
    <PARAMETER name="jmsReplyTimeout">5000</PARAMETER>
    <PARAMETER name="jmsReplyQueue">FXH.TRANSSERVER.SYNC.REPLY.QUEUE</PARAMETER>
</PARAMETERSET>

<EVENT>
    <NAME>Distribution - Business Day Open</NAME>
    <TYPE>BusinessDayStatusChange</TYPE>
    <EXEC>com.ibm.paydir.ima.txsvr.event.appbridge.BusinessDayStateEventHandler</EXEC>

    <PARAMETER name="msgType">BDayActive</PARAMETER>
    <PARAMETER name="stateName">OPEN</PARAMETER>
    <PARAMETER name="responseRequired">TRUE</PARAMETER>

    <PARAMETERREF>schedulerReferenceProperties</PARAMETERREF>
    <PARAMETERREF>sendToDistribution</PARAMETERREF>
    <PARAMETERREF>syncReplyQueue</PARAMETERREF>
</EVENT>

Parameters that are defined in the event stanza and not in one of the PARAMETERSET tags are specific to the event stanza. If a parameter is defined in both a PARAMETERSET and the event stanza, the value in the event stanza is used.

The other parameters are specific for their own events and should be specified in the Scheduler.xml file. If a parameter is defined in both the parmFileName file and in the Scheduler.xml file, the value defined in the Scheduler.xml file is used.