Running the Data Warehouse sample

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

  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 contents of the sample's database depends on which database product is installed. For DB2 databases use the tools provided by DB2; for example, the DB2 Control Center. If you have not installed a database product, the samples use the Apache Derby database. For instructions on how to view the data in a Derby database see Viewing the contents of a Derby database.

To run the WarehouseData message flow:

  1. Ensure that the sample message flows and message set have been deployed.
    When you imported the sample there might have been a number of warnings relating to .msgflow files. These are database related and will not affect the running of the sample.
  2. In the Message Brokers Toolkit, switch to the Broker Application Development perspective.
  3. In the Broker Development view, expand the Data Warehouse message flow project, then double-click Datawarehouse_input_message.mbtest to open it in the Test Client.
  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 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 database. Note the time at which the message was stored in the database. You will need to use this time when running the VerifyDatabaseContents message flow.
Next, run the VerifyDatabaseContents message flow to count the records in the database.  To do this:
  1. In the Broker Development view, expand the Data Warehouse message flow project, then double-click Datawarehouse_verify_contents_input_message.mbtest to open it in the Test Client.
  2. In the Message Data portion of the screen specify values for the start and end date and time of the query.  These values should 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.
  3. Click Send Message to place a WebSphere MQ message on the input queue of the VerifyDatabaseContents message flow.
  4. In the Test Client click Dequeue.
  5. Click Get Message to read a message from the DATAWAREHOUSE_VERIFY_CONTENTS_OUT_Q
  6. Verify that the count of records in the database is one.
  7. Perform several more archive requests using the WarehouseData message flow and verify that the record count in the database continues to increase at the same rate 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 need to update the value in Datawarehouse_verify_contents_input_message.mbtest.

After you have observed that the archive request was 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