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 an Oracle Advanced Queue or JMS topic. 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.

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

If the message type being used is not SYS.AQ$_JMS_MESSAGE,you must 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.

To use the Message Resubmission Utility:

  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 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.

    To disable a property, comment it out in the ResubmissionParams.properties file.

  3. Set these values in the ResubmissionParams.properties file located in $AIA_HOME/util/AIAMessageResubmissionUtil.

  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 command: ant buildfile MessageResubmit.xml

    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.

Example 17-1 is the ResubmissionParams.properties file for the AIA JMS sample:

Example 17-1 ResubmissionParams.properties File for the AIA JMS Sample

@ jms.app.hostName=sdc60024sems.us.oracle.com
jms.app.admin.port=7097
jms.app.soa.port=8097
jms.app.userName=weblogic
@ jms.app.password=weblogic#1
jms.aq=false
jms.moduleName=AIAJMSModule
jms.resourceCFJndi=jms/aia/AIAEbizCF
jms.errorResourceCFJndi=jms/aia/AIAErrorCF
#QUEUE/TOPIC - 1/2
resourceType=1
#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