Replaying recorded messages (record and replay)

To assist with troubleshooting or auditing, use record and replay to view messages that pass through configured IBM® App Connect Enterprise message flows. You can then replay selected messages to an IBM MQ queue.

About this task

When you enable record and replay for an App Connect Enterprise message flow, you configure flow monitoring events on the message flow nodes to publish each event to a specified topic. The recording function subscribes to these monitoring events and stores them in a database. You can then replay a specific message by sending it to an IBM MQ queue. For more information, see Record and replay in the App Connect Enterprise documentation.

When you deploy a record-and-replay enabled message flow to App Connect, you add configurations to the runtime that provide details of the required database and IBM MQ queue. You can view and download the recorded messages for your deployed flow on the Data tab of the runtime. If you have appropriate permissions, you can then replay selected messages by sending them to a specified IBM MQ queue.

Configuring a deployed message flow for record and replay

Before you begin

  • You can replay messages in App Connect for message flows that were enabled for record and replay in App Connect Enterprise. To enable data recording in App Connect Enterprise, you need to configure data stores and use monitoring events to specify which data you want to record. For more information, see Recording data in the App Connect Enterprise documentation.
  • You must have access to an IBM MQ queue.
  • You must have access to one of the following supported databases.
    • IBM Db2®
    • Microsoft SQL Server
    • Oracle
    • PostgreSQL
    For more information, see Configuring a database for recording data in the App Connect Enterprise documentation.

Procedure

The following instructions describe the configurations that you need to apply when you deploy an App Connect Enterprise message flow that is enabled for record and replay.

  1. In App Connect, create the following configurations on the Configurations tab of the Manage page.
    For more information, see Configuration types.
    server.conf.yaml
    Create a server.conf.yaml configuration to configure data stores, sources, and destinations for record and replay data.
    • Set remoteDefaultQueueManager to the name of your Policy project configuration that contains the details of your IBM MQ queue manager.
    • Make sure that recordReplayEnabled is not commented out and is set to true.
    • Copy and customize the Stores and Sources templates for the stores and sources that you want to create. For more information, see Configuring data recording in the App Connect Enterprise documentation.
    • Copy and customize the Destinations template for the IBM MQ queue where you want to send messages. For more information, see Replaying data in the App Connect Enterprise documentation.
    The following example shows the record and replay section of a server.conf.yaml file.
    RecordReplay:
      recordReplayEnabled: true        
      Stores:
        MBRECORD_store:
          backoutQueue: 'SYSTEM.BROKER.DC.BACKOUT'  
          dataSource: 'USERDB'
          schema: 'myDatabaseSchema'
          storeMode: 'all'
      Sources:
        MBRECORD_source:
          topic: '$SYS/Broker/integration_server/Monitoring/#/#/#' 
          store: 'MBRECORD_store' 
      Destinations:
        MQDestination:
          endpointType: 'WMQDestination'             
          endpoint: 'wmq:/msg/queue/SYSTEM.BROKER.DC.REPLAY'
    Policy project
    Create a Policy project configuration to provide details of the IBM MQ queue manager.

    You can use the policy project builder to create or update a Policy project configuration. (For more information, see Creating a Policy project configuration.) Alternatively, in the IBM App Connect Enterprise Toolkit, create an MQEndpoint policy, add it to a .zip file, then import it into App Connect to create your configuration. (For more information, see Creating policies with the App Connect Enterprise Toolkit and MQEndpoint policy in the App Connect Enterprise documentation.)

    The following example shows the content of the XML file for an MQEndpoint policy. The value of the securityIdentity property must match the value of the resource property in the setdbparms.txt configuration for the queue manager.
    <?xml version="1.0" encoding="UTF-8"?>
    <policies>
      <policy policyType="MQEndpoint" policyName="mqPolicy" policyTemplate="MQEndpoint">
        <connection>CLIENT</connection>
        <destinationQueueManagerName>queue manager name</destinationQueueManagerName>
        <queueManagerHostname>queue manager hostname</queueManagerHostname>
        <listenerPortNumber>1414</listenerPortNumber>
        <channelName>channel name</channelName>
        <CCDTUrl></CCDTUrl>
        <securityIdentity>MQ</securityIdentity>
        <useSSL>false</useSSL>
        <SSLPeerName></SSLPeerName>
        <SSLCipherSpec></SSLCipherSpec>
        <SSLCertificateLabel></SSLCertificateLabel>
        <MQApplName></MQApplName>
        <reconnectOption>default</reconnectOption>
      </policy>
    </policies>
    db2cli.ini
    If you're using an IBM Db2 database, create a db2cli.ini configuration that provides details of the database. For more information, see db2cli.ini configuration. This configuration is required for IBM Db2 databases only.
    The following example shows a db2cli.ini file.
    [USERDB]
    Database=USERDB
    Protocol=TCPIP
    Hostname=localhost
    Port=9000
    odbc.ini
    Create an odbc.ini configuration to specify ODBC connection details for the database. For more information, see odbc.ini configuration.
    The following example shows the typical format of an odbc.ini file with IBM Db2 settings. For details of how to configure other supported databases, see Creating and configuring a database for recording data in the App Connect Enterprise documentation.
    ;#######################################
    ;#### List of data sources stanza ######
    ;#######################################
    
    [ODBC Data Sources]
    USERDB=IBM Data Server Driver included in App Connect Enterprise
    
    ;###########################################
    ;###### Individual data source stanzas #####
    ;###########################################
    
    ;# IBM Data Server Driver included in App Connect Enterprise
    ;# Use of this driver requires additional configuration of Db2 configuration files 'db2cli.ini'
    ;# or 'db2dsdriver.cfg', and the setting of additional environment variables.
    ;# Refer to the documentation for details of the required configuration.
    [USERDB]
    DRIVER=/opt/ibm/ace-13/server/ODBC/dsdriver/odbc_cli/clidriver/lib/libdb2o.so
    Description=IBM Db2 ODBC Database accessed by using the IBM Data Server Driver included in App Connect Enterprise
    Database=USERDB
    
    ;##########################################
    ;###### Mandatory information stanza ######
    ;##########################################
    
    [ODBC]
    InstallDir=/opt/ibm/ace-13/server/ODBC/drivers
    UseCursorLib=0
    IANAAppCodePage=4
    UNICODE=UTF-8
    setdbparms.txt
    Create two setdbparms.txt configurations: one to specify credentials for the database, and one with credentials for the IBM MQ queue manager. For more information, see setdbparms.txt configuration.
    The setdbparms.txt file contains one or more mqsisetdbparms commands. The following example shows an mqsisetdbparms command with credentials for a database.
    mqsisetdbparms -w /home/aceuser/ace-server -n USERDB -u myUserID -p myPassword
    The following example shows an mqsisetdbparms command with credentials for an IBM MQ queue manager. The value of the resource property must match the securityIdentity property of the MQEndpoint policy file and must have a prefix of mq::.
    mqsisetdbparms --work-dir /home/aceuser/ace-server/ --resource mq::securityIdentityName -u myUserID -p myPassword
  2. Import and deploy the BAR file that contains the record-and-replay enabled message flow.
    For more information, see Deploying integrations.
  3. In the Configurations section of the deployment process, select the six configurations that you created.
  4. View the summary of what you're deploying, then click Deploy.

Replaying recorded data

Before you begin

To replay messages in App Connect, you must have editor or admin access. If you have viewer access, you can see the Messages tab only and can view transactions, but you can’t select or replay them. For more information, see Administering access in the IBM webMethods Hybrid Integration documentation.

Procedure

The following instructions describe how to view and replay messages for a deployed message flow that is enabled for record and replay.

  1. On the Runtimes tab of the Manage page, open the runtime that is configured for record and replay.
  2. Go to the Data tab for the selected runtime.
    The Data tab lists the data stores that are configured for the deployed message flow.
    A selected runtime has a Data tab that shows two data stores.
  3. Click a data store to open it.

    Use the Messages tab to view information about the messages in your message flow, and use the Replay tab to replay messages.

    The Messages tab lists all the messages that were recorded as they passed through the message flow. To sort data in ascending or descending order, click a column header. To filter messages, click Filters, then add a condition.
    When you click Filters, the Build a query dialog box opens. Click Add condition to add a condition to filter against, then click Apply.
    To control what data is shown in the table for your messages, click Customize table The Customize table icon. Select the types of data that you want to see, then click Save.
    The Customize table dialog box shows a list of data types, such as flow name, event source, library name, and local transaction ID. Each data type has a checkbox. Selected data types are represented by a column in the messages table.
    Click a timestamp in the Event time column to see more details for that transaction.
    • The Properties tab shows information about the message, such as the names of the input queue and the message flow node.
      The Properties tab shows details about the selected message, such as the ID, application name, event name, and event source.
    • The Data tab shows the data that passed through the message flow. You can also download the data from this tab.
      The Data tab shows the data in the selected message. To download the data, click Download this bitstream.
  4. To replay a transaction, select the transaction in the table by using the checkbox, then click Mark for replay.
    When you select a message in the table, the Mark for replay link appears.

    The marked transaction is listed on the Replay tab for the data store.

    If you decide that you don’t want to replay this transaction, select it by using the checkbox, then click Remove.

  5. On the Replay tab, select the destination queue where you want to replay the transaction.
    The Replay to field lists the IBM MQ queues that you configured.
    The Replay to field lists the IBM MQ queues that you configured. Select the queue where you want to replay your message.
  6. Select the transaction, then click Replay.
    When you select a message on the Replay tab, the Replay link appears. Click the link to replay the message to the selected queue.

Results

The replay status changes to Replaying. If the message was replayed successfully, the value in the Replay status column changes to Success. If the message wasn't replayed successfully, the status is Failure. Check the logs for messages that explain the failure. For more information, see Viewing log messages in the log viewer.