Playing Back Multiple Scripts Serially (MQ)


This scenario demonstrates playing back the same script serially, multiple times, to ensure the application behaves consistently.

It begins by capturing activity from the entire customer order and credit inquiry application (Flowchart for the Sample Customer Order And Credit Inquiry Application); then generating a script containing only the activity produced by the PDA016 Customer Order Inquiry Program (Activity Captured in Sample Script SCRMS000). The script drives the rest of the application during playback. PDA017 Customer Order Inquiry Program and PDA018 Credit Inquiry Program should respond to a given request the same way each time the script is played back. For example, if the script contained a single transaction requesting Bill Smith’s order and credit authorization, PDA017 and PDA018 should return Bill Smith’s order information and the same credit authorization each time you play back the script.

Activity Captured in Sample Script SCRMS000

image2021-2-19_10-45-18.png

This scenario also requires editing the script and the SCRIPT statements in the log file before submitting the unattended playback job.

The rest of this section details each of these steps, except for capture. Use the filtering information provided in this discussion to generate scripts from sample repository REPOS1. Then run an analyze job on each script, saving the sorted data, and generate a baseline HTML Exception Report to ensure that the script you created contains the same activity as the sample script.

Supporting sample files

The sample files supporting this scenario include:

  • Repository: REPOS1
  • Log: LOGMS000
  • Script:
    SCRMS000 (original script),
    SCRMS001 (contains all but the MQ_DISCONNECTS from the original script), SCRMS002 (contains all MQ_DISCONNECTs associated with the activity in the original script)

Filters

REPOS1 contains activity for the entire customer order and credit inquiry program (Flowchart for the Sample Customer Order And Credit Inquiry Application). Apply the following three filters during script creation to generate a script containing only PDA016’s activity. Refer to Activity Captured in Sample Script SCRMS000 to see the application flow of PDA016 and the names of the queues it uses.

Filter 1

Field Name

RO

Filtering Criteria

Queue manager

EQ

*

Object/Queue name

EQ

PDAPROD.H01AC013.CUSTOMER.QUEUE.ALIAS

Event

EQ

PUT

Filter 2

Field Name

RO

Filtering Criteria

Queue manager

EQ

*

Object/Queue name

EQ

PDAPROD.H01AC013.CUSTOMER.RESPONSE.QUEUE.ALIAS

Event

EQ

GET

Filter 3

Field Name

RO

Filtering Criteria

Queue manager

EQ

*

Object/Queue name

EQ

PDAPROD.H01AC013.CREDIT.AUTH.RESP.QUEUE.

Event

EQ

GET


Important

Enter this filtering information on the Header Filter Detail screen (WebSphere MQ - Header Filter Detail Screen) in the Create MQ Script facility. Also, be sure to select the Log Entries field on the WebSphere MQ Create Scripts - Create Options screen (2 of 2) to generate a LOG file that you can compare to the sample LOG file.

Script and log editing requirements

Serial playback of multiple scripts or the same script multiple times is achieved by placing the appropriate SCRIPT statements under the same MQGROUP statement.

Performance Test for WebSphere MQ processes all activity on a connection ID until an MQ_DISCONNECT is encountered. After the disconnect is processed, that connection ID cannot be used again during playback of the given MQGROUP. The Connection IDs within a script are numbered sequentially. Therefore, two scripts will contain minimally one connection ID that is the same. If you plan to serially play back the same script, the same connection IDs are processed for each replay. To avoid failed connections during replay, remove the MQ_DISCONNECTS from all scripts within the group and save them in a separate PDS member. Play this member back as the last script in the group to process the MQ_DISCONNECTs.

Refer to the following samples to see how this is done.

  • SCRMS000 contains all of the activity for PDA016.
  • SCRMS001 has had the MQ_DISCONNECTs edited out.
  • SCRMS002 contains the removed MQ_DISCONNECTs.

After you have edited the disconnects out of the scripts, open the LOG file you generated while creating your scripts. Scroll to the bottom to locate the script statements. The SCRIPT statement in your LOG file should look something like this, except the script name (SCRMS000) will reflect the name you provided.

* SCRIPT NUMBER(1)
MQGROUP-
ID(1)-
STIME('2006/06/26_10:55:54.685787')
SCRIPT(SCRMS000)
  1. Change the script name to point to the script without the MQ_DISCONNECTs.
  2. Either add the REPEAT parameter to the SCRIPT statement or copy the SCRIPT statement as many times as desired to play it back. See SCRIPT Statement.
  3. At the end, add a SCRIPT statement to play back the file containing the MQ_DISCONNECTS.

Sample LOG file LOGMS000 reflects these edits:

* SCRIPT NUMBER(1)
MQGROUP-
ID(1)-
STIME('2006/06/26_10:55:54.685787')
SCRIPT(SCRMS001)
SCRIPT(SCRMS001)
SCRIPT(SCRMS001)
SCRIPT(SCRMS002)



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*