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 may have been a number of warnings relating to .msgflow files. These are database related and will not affect the running of the sample.
  2. Double click Datawarehouse_input_message.enqueue in the message flow project into which the sample was imported.
  3. Review the values for Queue manager name and Queue name on the General tab.  When using the default queue manager and Message Broker configuration there is no need to change the values.
  4. Click Write to queue to place a WebSphere MQ message on the input queue of the WarehouseData message flow.
  5. Start an instance of the Dequeue application:
    1. On the workbench toolbar, click the arrow on the Get a message from a Queue icon Get a message from a Queue
    2. On the drop-down menu, click Get Message to open the Dequeue Message window.
    3. Enter the names for the queue manager and queue that you want.  Use values of WBRK6_DEFAULT_QUEUE_MANAGER for the queue manager name and DATAWAREHOUSE_OUT_Q for the queue name to work with the default configuration.
    4. Click Read From Queue to read a message from the queue.
    5. After closing the window, the next time that you click the arrow on the Get a message from a Queue icon Get a message from a Queue, you will see the dequeue configuration that you created above listed on the drop-down menu. Click this file on the menu (or if it is number 1 on the menu, just click the icon itself) to get a message from the queue.
    6. Optional: While the Dequeue Message window is open, you can save a read message into a file in your message flow project to keep it for later. Click Save As, and in the Save Message As window, select the flow project and enter a name for the file.
  6. 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.
  7. Start another instance of the Dequeue application (same process as for step 5 above).
  8. Use values of WBRK6_DEFAULT_QUEUE_MANAGER for the queue manager name and DATAWAREHOUSE_FAILURE_Q for the queue name to work with the default configuration.
  9. Click Read From Queue to read a message from the queue.
  10. Verify that no message was retrieved .  This instance of the Dequeue application is reading any error messages for the database insert.  There should not be any.
At this point the WarehouseData message flow has been successfully run.  The next step is to run the VerifyDatabaseContents message flow to count the records in the database.  To do this:
  1. Double click Datawarehouse_verify_contents_input_message.enqueue in the message flow project into which the sample was imported.
  2. Review the values for Queue manager name and Queue name on the General tab.  When using the default queue manager and Message Broker configuration there is no need to change the values.
  3. 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.
  4. Click Write to queue to place a WebSphere MQ message on the input queue of the VerifyDatabaseContents message flow.
  5. Start another instance of the Dequeue application:
  6. Use values of WBRK6_DEFAULT_QUEUE_MANAGER for the queue manager name and DATAWAREHOUSE_VERIFY_CONTENTS_OUT_Q for the queue name to work with the default configuration.
  7. Click Read From Queue to read a message from the queue.
  8. Verify that the count of records in the database is one.
  9. 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 may need to update the value in the file Datawarehouse_verify_contents_input_message.enqueue

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.

Main Page icon   Back to sample home