Running the Data Warehouse sample

You can run the Data Warehouse sample to perform the following processes:

  1. Read a WebSphere MQ message with a payload in XML format
  2. Convert all of the incoming message payload into a BLOB and insert it into a database
  3. Format a confirmation message
  4. Write a WebSphere MQ message confirming insertion of the message into the database
  5. Verify the number of records that have been inserted into the database

How you view the sample database contents depends on which database product is installed. For DB2 databases use the tools provided by DB2; for example, the DB2 Control Center.

If you encounter any problems when you run the sample, see Resolving problems when running samples in the WebSphere Message Broker documentation.

Note. If an error arises during the database processing, a message is formatted in the Create_Error_Message Compute node and written out in the Data_Warehouse_Failure_Q MQOutput node as a WebSphere MQ message.

To run the WarehouseData message flow:

  1. Ensure that the sample message flows and message set are deployed.
    When you import the sample, a number of warnings might be issued relating to .msgflow files. These warnings are database related and do not affect the running of the sample.
  2. In the Broker Development view, expand the Data Warehouse message flow project and, under Flow Tests, double-click Datawarehouse_input_message.mbtest to open it in the Test Client.
  3. In the Test Client, click Enqueue.
  4. Click Send Message to place a WebSphere MQ message on the input queue of the WarehouseData message flow.
  5. In the Test Client, click Dequeue.
  6. Click the first Get Message to read a message from the DATAWAREHOUSE_OUT_Q queue.
  7. View the contents of the message that is retrieved and verify that a message was stored in the DATAWAREHOUSE table in the USERDB database. Take a note of the time at which the message was stored in the database. You must use this time when you are running the VerifyDatabaseContents message flow.

Run the VerifyDatabaseContents message flow to count the records in the database by completing the following steps:

  1. In the Broker Development view, expand the Data Warehouse message flow project and, under Flow Tests, double-click Datawarehouse_verify_contents_input_message.mbtest to open it in the Test Client.
  2. In the Test Client, click Enqueue.
  3. In the Message Data portion of the screen, specify values for the start date, end date, and time of the query. You must select appropriate values to enter. These values must be either side of the time at which the database insert took place when you ran the WarehouseData message flow. The time of the insert is reported in the message, which is written to DATAWAREHOUSE_OUT_Q.
  4. Click Send Message to place a WebSphere MQ message on the input queue of the VerifyDatabaseContents message flow.
  5. In the Test Client, click the first Dequeue.
  6. Click Get Message to read a message from the DATAWAREHOUSE_VERIFY_CONTENTS_OUT_Q
  7. Verify that the count of records in the database is 1.
  8. Perform several more archive requests by using the WarehouseData message flow, and verify that the record count in the database continues to increase at the same rate by using the VerifyDatabaseContents message flow to obtain the count of the number of records in the database. Dependent on the value of the end time that you initially specified, you might have to update the value in Datawarehouse_verify_contents_input_message.mbtest.

After you have observed that the archive request has completed successfully, and that the count of records in the database corresponds with the number of archives issued, you have successfully run the Data Warehouse sample.

Back to sample home