17 Using the Message Resubmission Utility

This chapter includes the following sections:

17.1 Introduction to the Message Resubmission Utility

To use the Message Resubmission Utility, you must implement error handling and recovery for the asynchronous message exchange pattern.

For more information, see "Configuring Oracle AIA Processes for Error Handling and Trace Logging" in Oracle Fusion Middleware Developer's Guide for Oracle Application Integration Architecture Foundation Pack.

According to this implementation method, when a message cannot be delivered to a service or component in the flow of a global transaction, the message is rolled back to the appropriate source milestone. This source milestone corresponds to a Queue or topic or Resequencer. It is here that the message will be persisted until it can be resubmitted for delivery to the service or component.

At the same time, a fault is raised by the Error Handling framework and, if enabled, error notifications and Oracle BPM Worklist tasks regarding the fault are created to alert administrators.

For more information about the Oracle BPM Worklist, see Chapter 16, "Using the Oracle BPM Worklist."

For more information about error notifications, see Chapter 15, "Using Error Notifications."

Once notified, the most natural course of action is for the administrator to bring up the failed service or component. Once the service or component is back up and running, the administrator can use the Message Resubmission Utility to recover the faulted message from the source milestone.

The Message Resubmission Utility changes the state of the faulted message to the Ready state, enabling it to be picked up by the consumer process.

17.2 How to Use the Message Resubmission Utility

This section discusses how to use the Message Resubmission Utility to resubmit a faulted message.

It can be done in three ways:

  • Oracle AQ store based or

  • WLS JMS store based (can be configured with file system or db).

  • Resequencer based

17.2.1 AQ Store Based Resubmission

  1. For message resubmission scenarios that involve Oracle Advanced Queue, Topic, internally the MSG_RESUBMIT stored procedure is used. This procedure assumes that the message type is SYS.AQ$_JMS_MESSAGE.

    If the message type being used is not SYS.AQ$_JMS_MESSAGE, change the data type for the MSG variable in the MSG_RESUBMIT stored procedure and then recompile the procedure. You can then use the Message Resubmission Utility for resubmission based on message ID.

    For more information about configuring a queue with AQ to support resubmission, see "Configure AQ JMS Foreign Server Destinations" in Oracle Fusion Middleware Configuring and Managing JMS for Oracle WebLogic Server.

  2. Access the Oracle AIA log file, <DOMAIN_HOME>/servers/<SOA Server Name>/logs/aia-error.log to look up the following values included in the IntermediateMessageHop element for the message that requires resubmission:

    • SenderResourceTypeCode

    • SenderResourceID

    • SenderMessageID

    For more information about these values in the context of the Oracle AIA fault message schema, see "Configuring Oracle AIA Processes for Error Handling and Trace Logging" in Oracle Fusion Middleware Developer's Guide for Oracle Application Integration Architecture Foundation Pack.

    Alternatively, you can also look up the aia-error.log in the Oracle Enterprise Manager.

    1. Under WebLogic Domain, <domain name>, right-click the manage server entry (usually soa_server1).

    2. Navigate to Logs, View Log Messages. On the Log Message page, provide search criteria (optional) and click the Search button.

    For more information about viewing the Oracle AIA log in Oracle Enterprise Manager, see Chapter 18, "Using Trace and Error Logs."

  3. AIAResubmissionUtility is available under $AIA_HOME/util, so browse to $AIA_HOME/util/AIAResubmissionUtility. Set all the required values in ResubmissionParams.properties file.

    Note:

    Since it is AQ based resubmission, jms.aqproperty in the properties file should be set to true in the properties file. The messageIDshould be in normal format, and should not start with ID : < >

    Example 17-1 Sample ResubmissionParams.properties for AQ based Resubmission

    jms.app.hostName=hostservername.domain.com
    jms.app.admin.port=port
    jms.app.soa.port=8097
    jms.app.userName=weblogic
    jms.app.password=password
    jms.aq=true
    jms.moduleName=AIAJMSModule
    jms.resourceCFJndi=
    jms.errorResourceCFJndi=
    #QUEUE/TOPIC/RESEQUENCER - 1/2/3
    resourceType=1
    #queueName/topicName/routingServiceName
    resourceName=AIA_SiebelCustomerJMSQueue
    #messageID/groupID
    messageID= 7109EDC5FFD9BA25E04014908FC62C90
    #queueTableName/topicTableName
    aq.resourceTableName=AIASamples
    aq.db.driverName=oracle.jdbc.driver.OracleDriver
    aq.db.jdbcURL=jdbc:oracle:thin:@localhost:1521:XE
    aq.db.userName=aia 
    aq.db.password=aia
    
  4. For Windows, execute $AIA_INSTANCE\bin\aiaenv.bat.

    For Linux, source $AIA_INSTANCE/bin/aiaenv.sh.

  5. Navigate to $AIA_HOME/util/AIAMessageResubmissionUtil and execute the following:

    ant –f MessageResubmit.xml -logfile $AIA_HOME/util/AIAResubmissionUtility/MessageResubmit.log
    

    The MessageResubmit.xml script references the edited ResubmissionParams.properties file. Once run, the script resets the message status back to a ready state so that the transaction can resume its flow.

17.2.2 WLS JMS based Resubmission

  1. Access the Oracle AIA log file, <DOMAIN_HOME>/servers/<SOA Server Name>/logs/aia-error.log, to look up the following values included in the IntermediateMessageHop element for the message that requires resubmission:

    • SenderResourceTypeCode

    • SenderResourceID

    • SenderMessageID

    For more information about these values in the context of the Oracle AIA fault message schema, see "Configuring Oracle AIA Processes for Error Handling and Trace Logging" in Oracle Fusion Middleware Developer's Guide for Oracle Application Integration Architecture Foundation Pack.

    Alternatively, you can also look up the aia-error.log in the Oracle Enterprise Manager.

    1. Under WebLogic Domain, <domain name>, right-click the manage server entry (usually soa_server1).

    2. Navigate to Logs, View Log Messages. On the Log Message page, provide search criteria (optional) and click the Search button.

    For more information about viewing the Oracle AIA log in Oracle Enterprise Manager, see Chapter 18, "Using Trace and Error Logs."

  2. You may optionally define jms.resourceCFJndi= and jms.errorResourceCFJndi= property values in the ResubmissionParams.properties file. The default values for the error jndi are fetched based on the resourceName that is provided in the properties file by using the mbean infrastructure. The connection factories are derived based on the naming standards. See the second list item below.

    • The jms.resourceCFJndi= property defines a resource-specific ConnectionFactory that will be used to connect to the resource error queue. In this context, a resource is a JMS queue or topic. This property cannot have multiple values, even if you have multiple connection factories. You must specify one ConnectionFactory to be used by the resubmission script.

    • If the resource name is AIASamples_Queue and the JNDI is jndi/aia/AIASamples_Queue, the ConnectionFactory property value would be jndi/aia/AIASamples_QueueCF.

    • The jms.errorResourceCFJndi= property defines a generic ConnectionFactory that will be used to connect to all resource error queues that are not explicitly defined using the jms.resourceCFJndi= property. If you do not define this value, it will be automatically generated during Foundation Pack installation as jms.errorResourceCFJndi=jms/aia/AIAErrorCF.

  3. AIAResubmissionUtility is available under $AIA_HOME/util, so browse to $AIA_HOME/util/AIAResubmissionUtility. Set all the required values in ResubmissionParams.properties file.

    Note:

    Since it is WLS JMS based resubmission, jms.aq property in the properties file should be set to false in the properties file. The messageIDshould be in the format ID : < >

    Example 17-2 Sample ResubmissionParams.properties for WLS JMS based Resubmission

    jms.app.hostName=hostname.domain.com
    jms.app.admin.port=port
    jms.app.soa.port=8097
    jms.app.userName=weblogic
    jms.app.password= password
    jms.aq=false
    jms.moduleName=AIAJMSModule
    jms.resourceCFJndi=jms/aia/AIAEbizCF
    jms.errorResourceCFJndi=jms/aia/AIAErrorCF
    #QUEUE/TOPIC/RESEQUENCER - 1/2/3
    resourceType=3
    #queueName/topicName/routingServiceName
    resourceName=AIA_SiebelCustomerJMSQueue
    #messageID/groupID
    messageID=ID:<983029.1264581138423.0>
    #queueTableName/topicTableName
    aq.resourceTableName=AIASamples
    aq.db.driverName=oracle.jdbc.driver.OracleDriver
    aq.db.jdbcURL=jdbc:oracle:thin:@localhost:1521:XE
    aq.db.userName=aia 
    aq.db.password=aia
    
  4. For Windows, execute $AIA_INSTANCE\bin\aiaenv.bat.

    For Linux, source $AIA_INSTANCE/bin/aiaenv.sh.

  5. Navigate to $AIA_HOME/util/AIAMessageResubmissionUtil and execute the following:

    ant -f MessageResubmit.xml -logfile $AIA_HOME/util/AIAResubmissionUtility/MessageResubmit.log

    The MessageResubmit.xml script references the edited ResubmissionParams.properties file. Once run, the script resets the message status back to a ready state so that the transaction can resume its flow.

17.2.3 Resequencer Based Resubmission

  1. Faults/rejected messages which are marked as Recovery Needed in the EM Console can only be resubmitted using AIAResubmissionUtility. To get the list of faulted/rejected messages in the EM Console, navigate to SOA, click on corresponding domain and navigate to Faults and Rejected messages tab in the middle pane.

  2. Make a list of all faulted instances (which are marked as Recovery Needed).

  3. Get the composite name and messageID/GroupId (xpath of the messageID is defined at the design time of the resequencer) of the faulted instances.

  4. AIAResubmissionUtility is available under $AIA_HOME/util. Navigate to $AIA_HOME/util/AIAResubmissionUtility and set all the required values in ResubmissionParams.properties file.

    Note:

    The resourceName should be in the format default/<compositeName>!<version>. Multiple messageID's of a particular composite can be set for messageID property with comma “,” as a delimiter. 7109EDC5FFD9BA25E0401, 9EDC5FFD9BA25E04014908F.

    Example 17-3 Sample ResubmissionParams.properties for Resequencer based Resubmission

    jms.app.hostName=serverhostname.domain.com
    jms.app.admin.port=adminport
    jms.app.soa.port=soaport
    jms.app.userName=weblogic
    jms.app.password=password
    jms.aq=false
    jms.moduleName=AIAJMSModule
    jms.resourceCFJndi=
    jms.errorResourceCFJndi=
    #QUEUE/TOPIC/RESEQUENCER - 1/2/3
    resourceType=3
    #queueName/topicName/routingServiceName
    resourceName=default/JMSConsumer!1.0
    #messageID/groupID
    messageID=7109EDC5FFD9BA25E0
    #queueTableName/topicTableName
    aq.resourceTableName=AIASamples
    aq.db.driverName=oracle.jdbc.driver.OracleDriver
    aq.db.jdbcURL=jdbc:oracle:thin:@localhost:1521:XE
    aq.db.userName=aia 
    aq.db.password=aia
    
  5. For Windows, execute $AIA_INSTANCE\bin\aiaenv.bat.

    For Linux, source $AIA_INSTANCE/bin/aiaenv.sh.

  6. Navigate to $AIA_HOME/util/AIAMessageResubmissionUtil and execute the following:

    ant –f MessageResubmit.xml -logfile $AIA_HOME/util/AIAResubmissionUtility/MessageResubmit.log

    The MessageResubmit.xml script references the edited ResubmissionParams.properties file. Once run, the script resets the message status back to a ready state so that the message can resume its execution flow.